Skip to content

Commit

Permalink
Fix opening articles pages (sequel of issue ViennaRSS#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
barijaona committed Jan 5, 2013
1 parent dca9215 commit 986b411
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/AppController.m
Expand Up @@ -1310,7 +1310,13 @@ -(IBAction)openWebLocation:(id)sender
*/
-(void)openURLFromString:(NSString *)urlString inPreferredBrowser:(BOOL)openInPreferredBrowserFlag
{
[self openURL:[NSURL URLWithString:urlString] inPreferredBrowser:openInPreferredBrowserFlag];
NSURL * theURL = [NSURL URLWithString:urlString];
if (theURL == nil)
{
NSString * escapedText = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
theURL = [NSURL URLWithString:escapedText];
}
[self openURL:theURL inPreferredBrowser:openInPreferredBrowserFlag];
}

/** openURLs
Expand Down Expand Up @@ -2502,8 +2508,13 @@ -(void)viewArticlePages:(id)sender inPreferredBrowser:(BOOL)usePreferredBrowser
if (currentArticle && ![[currentArticle link] isBlank])
{
[articlesWithLinks addObject:currentArticle];
NSString * escapedText = [[currentArticle link] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[urls addObject:[NSURL URLWithString:escapedText]];
NSURL * theURL = [NSURL URLWithString:[currentArticle link]];
if (theURL == nil)
{
NSString * escapedText = [[currentArticle link] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
theURL = [NSURL URLWithString:escapedText];
}
[urls addObject:theURL];
}
}
[self openURLs:urls inPreferredBrowser:usePreferredBrowser];
Expand Down

0 comments on commit 986b411

Please sign in to comment.