TEXT   60
Google Reader copy
Guest on 27th August 2023 06:02:58 AM


  1. --- Google Reader copy/GRController.m   2007-03-11 18:45:56.000000000 +0800
  2. +++ Google Reader/GRController.m        2007-03-11 18:49:46.000000000 +0800
  3. @@ -1610,7 +1610,15 @@
  4.  
  5.         if ([[prefs valueForKey:@"dontVerifySubscription"] boolValue] != YES) {
  6.  
  7. -               [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[[NSString stringWithFormat:@"%@://www.google.com/reader/preview/*/feed/", [self getURLPrefix]] stringByAppendingString:url]]];                    
  8. +               NSMutableString * escapedUrl = [NSMutableString stringWithCapacity:([url length]*3)];   // for the worst case the length will growth to 3 times
  9. +               [escapedUrl setString:url];
  10. +               [escapedUrl replaceOccurrencesOfString:@"?" withString:@"%3F" options:0 range:NSMakeRange(0, [escapedUrl length])];
  11. +               [escapedUrl replaceOccurrencesOfString:@"&" withString:@"%26" options:0 range:NSMakeRange(0, [escapedUrl length])];
  12. +               [escapedUrl replaceOccurrencesOfString:@":" withString:@"%3A" options:0 range:NSMakeRange(0, [escapedUrl length])];
  13. +               [escapedUrl replaceOccurrencesOfString:@"/" withString:@"%2F" options:0 range:NSMakeRange(0, [escapedUrl length])];
  14. +               [escapedUrl replaceOccurrencesOfString:@"=" withString:@"%3D" options:0 range:NSMakeRange(0, [escapedUrl length])];
  15. +
  16. +               [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[[NSString stringWithFormat:@"%@://www.google.com/reader/preview/*/feed/", [self getURLPrefix]] stringByAppendingString:escapedUrl]]];                     
  17.                        
  18.         } else {

Raw Paste

Login or Register to edit or fork this paste. It's free.