diff --git a/React/Base/RCTConvert.m b/React/Base/RCTConvert.m index 33e2a094a0484a..5e4820585b0131 100644 --- a/React/Base/RCTConvert.m +++ b/React/Base/RCTConvert.m @@ -91,7 +91,7 @@ + (NSURL *)NSURL:(id)json } // Check if it has a scheme - if ([path rangeOfString:@":"].location != NSNotFound) { + if ([path rangeOfString:@"://"].location != NSNotFound) { NSMutableCharacterSet *urlAllowedCharacterSet = [NSMutableCharacterSet new]; [urlAllowedCharacterSet formUnionWithCharacterSet:[NSCharacterSet URLUserAllowedCharacterSet]]; [urlAllowedCharacterSet formUnionWithCharacterSet:[NSCharacterSet URLPasswordAllowedCharacterSet]]; diff --git a/packages/rn-tester/RNTesterUnitTests/RCTConvert_NSURLTests.m b/packages/rn-tester/RNTesterUnitTests/RCTConvert_NSURLTests.m index 2eb72a7a170078..7d3dadde38fbc8 100644 --- a/packages/rn-tester/RNTesterUnitTests/RCTConvert_NSURLTests.m +++ b/packages/rn-tester/RNTesterUnitTests/RCTConvert_NSURLTests.m @@ -45,6 +45,9 @@ -(void)test_##name \ TEST_BUNDLE_PATH(imageAt2XPath, @"images/foo@2x.jpg", @"images/foo@2x.jpg") TEST_BUNDLE_PATH(imageFile, @"foo.jpg", @"foo.jpg") +TEST_BUNDLE_PATH(imageFileWithSemicolon, @"folder/foo:bar-baz.jpg", @"folder/foo:bar-baz.jpg") +TEST_URL(filePathWithSemicolon, @"/folder/foo:bar-baz.jpg", @"file:///folder/foo:bar-baz.jpg") + // User documents TEST_PATH( documentsFolder,