summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-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.chromium2
2 files changed, 6 insertions, 3 deletions
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].