diff options
-rw-r--r-- | chrome/chrome_browser.gypi | 2 | ||||
-rw-r--r-- | third_party/mozilla/include/NSString+Utils.mm (renamed from third_party/mozilla/include/NSString+Utils.m) | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index c66ab1d..6457a44 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2603,7 +2603,7 @@ '../third_party/mozilla/include/NSScreen+Utils.h', '../third_party/mozilla/include/NSScreen+Utils.m', '../third_party/mozilla/include/NSString+Utils.h', - '../third_party/mozilla/include/NSString+Utils.m', + '../third_party/mozilla/include/NSString+Utils.mm', '../third_party/mozilla/include/NSURL+Utils.h', '../third_party/mozilla/include/NSURL+Utils.m', '../third_party/mozilla/include/NSWorkspace+Utils.h', diff --git a/third_party/mozilla/include/NSString+Utils.m b/third_party/mozilla/include/NSString+Utils.mm index c145505..bc6b342 100644 --- a/third_party/mozilla/include/NSString+Utils.m +++ b/third_party/mozilla/include/NSString+Utils.mm @@ -39,6 +39,7 @@ #import <AppKit/AppKit.h> // for NSStringDrawing.h #import "NSString+Utils.h" +#include "googleurl/src/gurl.h" @implementation NSString (ChimeraStringUtils) @@ -89,12 +90,12 @@ - (BOOL)isValidURI { - // This will only return a non-nil object for valid, well-formed URI strings - NSURL* testURL = [NSURL URLWithString:self]; + // isValid() will only be true for valid, well-formed URI strings + GURL testURL([self UTF8String]); // |javascript:| and |data:| URIs might not have passed the test, // but spaces will work OK, so evaluate them separately. - if ((testURL) || [self isLooselyValidatedURI]) { + if ((testURL.is_valid()) || [self isLooselyValidatedURI]) { return YES; } return NO; |