diff options
-rw-r--r-- | chrome/chrome_browser.gypi | 2 | ||||
-rw-r--r-- | third_party/mozilla/NSString+Utils.mm (renamed from third_party/mozilla/NSString+Utils.m) | 7 | ||||
-rw-r--r-- | third_party/mozilla/README.chromium | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 8e636d3..9b161c5 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2660,7 +2660,7 @@ '../third_party/mozilla/NSScreen+Utils.h', '../third_party/mozilla/NSScreen+Utils.m', '../third_party/mozilla/NSString+Utils.h', - '../third_party/mozilla/NSString+Utils.m', + '../third_party/mozilla/NSString+Utils.mm', '../third_party/mozilla/NSURL+Utils.h', '../third_party/mozilla/NSURL+Utils.m', '../third_party/mozilla/NSWorkspace+Utils.h', diff --git a/third_party/mozilla/NSString+Utils.m b/third_party/mozilla/NSString+Utils.mm index c145505..bc6b342 100644 --- a/third_party/mozilla/NSString+Utils.m +++ b/third_party/mozilla/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; diff --git a/third_party/mozilla/README.chromium b/third_party/mozilla/README.chromium index ab83407..658fd72 100644 --- a/third_party/mozilla/README.chromium +++ b/third_party/mozilla/README.chromium @@ -14,3 +14,5 @@ Description: Local modifications: NSURL+Utils.m was modified to use non-deprecated Cocoa APIs to allow compilation on future versions of Mac OS X. + NSString+Utils.m was renamed to NSString+Utils.mm and modified to use GURL + for validation in -[NSString isValidURI]. |