Changeset 89336 in webkit
- Timestamp:
- Jun 20, 2011 11:05:22 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89332 r89336 1 2011-06-20 Andy Estes <aestes@apple.com> 2 3 Reviewed by Darin Adler. 4 5 KURL::protocolIs(const char* protocol) asserts in Debug builds with 6 valid protocols 7 https://bugs.webkit.org/show_bug.cgi?id=61572 8 9 No new tests. No code currently calls protocolIs() with a protocol that 10 contains a non-letter character. 11 12 * platform/KURL.cpp: 13 (WebCore::isSchemeCharacterMatchIgnoringCase): A helper function that 14 compares two characters ignoring case. It assumes (and asserts) that 15 both characters are valid scheme characters, and that if the second 16 argument is a letter that it is lowercase. 17 (WebCore::KURL::protocolIs): Call isSchemeCharacterMatchIgnoringCase() 18 instead of isLetterMatchIgnoringCase(). 19 1 20 2011-06-20 Dai Mikurube <dmikurube@chromium.org> 2 21 -
trunk/Source/WebCore/platform/KURL.cpp
r87623 r89336 242 242 static inline bool isPathSegmentEndChar(UChar c) { return c <= 0xff && (characterClassTable[c] & PathSegmentEndChar); } 243 243 static inline bool isBadChar(unsigned char c) { return characterClassTable[c] & BadChar; } 244 245 static inline bool isSchemeCharacterMatchIgnoringCase(char character, char schemeCharacter) 246 { 247 ASSERT(isSchemeChar(character)); 248 ASSERT(schemeCharacter & 0x20); 249 ASSERT(isASCIILower(schemeCharacter) || (!isASCIIUpper(schemeCharacter) && isSchemeChar(schemeCharacter))); 250 return (character | 0x20) == schemeCharacter; 251 } 244 252 245 253 static inline int hexDigitValue(UChar c) … … 703 711 // Do the comparison without making a new string object. 704 712 for (int i = 0; i < m_schemeEnd; ++i) { 705 if (!protocol[i] || !is LetterMatchIgnoringCase(m_string[i], protocol[i]))713 if (!protocol[i] || !isSchemeCharacterMatchIgnoringCase(m_string[i], protocol[i])) 706 714 return false; 707 715 }
Note: See TracChangeset
for help on using the changeset viewer.