Changeset 80566 in webkit
- Timestamp:
- Mar 8, 2011 9:41:13 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r80565 r80566 1 2011-03-08 James Kozianski <koz@chromium.org> 2 3 Reviewed by David Levin. 4 5 Expose isValidProtocol() in KURL.h. 6 https://bugs.webkit.org/show_bug.cgi?id=54594 7 8 This is needed to validate protocols used in calls to 9 navigator.registerProtocolHandler(). 10 11 * platform/KURL.cpp: 12 * platform/KURL.h: 13 * platform/KURLGoogle.cpp: 14 (WebCore::isValidProtocol): 15 1 16 2011-03-08 Adam Roben <aroben@apple.com> 2 17 -
trunk/Source/WebCore/platform/KURL.cpp
r79956 r80566 222 222 static void encodeRelativeString(const String& rel, const TextEncoding&, CharBuffer& ouput); 223 223 static String substituteBackslashes(const String&); 224 static bool isValidProtocol(const String&);225 224 226 225 static inline bool isSchemeFirstChar(char c) { return characterClassTable[static_cast<unsigned char>(c)] & SchemeFirstChar; } -
trunk/Source/WebCore/platform/KURL.h
r79956 r80566 280 280 bool portAllowed(const KURL&); // Blacklist ports that should never be used for Web resources. 281 281 282 bool isValidProtocol(const String&); 283 282 284 String mimeTypeFromDataURL(const String& url); 283 285 -
trunk/Source/WebCore/platform/KURLGoogle.cpp
r79906 r80566 134 134 } 135 135 136 bool isValidProtocol(const String& protocol) 137 { 138 // NOTE This is a copy of the function in KURL.cpp. 139 // RFC3986: ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) 140 if (protocol.isEmpty()) 141 return false; 142 if (!isSchemeFirstChar(protocol[0])) 143 return false; 144 unsigned protocolLength = protocol.length(); 145 for (unsigned i = 1; i < protocolLength; i++) { 146 if (!isSchemeChar(protocol[i])) 147 return false; 148 } 149 return true; 150 } 151 136 152 137 153 // KURLGooglePrivate -----------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.