[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:12:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 424d4904e634c35f56f3f0b9b8499a585010aea0
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 17 23:12:35 2003 +0000

            Reviewed by Maciej
    
    	Fix for this bug:
    
    	<rdar://problem/3480023>: Links don't work if there's a colon in the URL
    
    	The colon in the URL was confusing KURL. I modified some checks in
    	KURL so that its search for schemes stops when a non-scheme
    	character is found rather than when a path end segment character
    	is found.
    
            * kwq/KWQKURL.mm: Added a new Colon class to the table of characters.
            (isSchemeCharOrColon): New helper.
            (KURL::KURL): Call on new helper when looking for a scheme.
            (KURL::findHostnameInHierarchicalURL): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5541 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 4eea4f5..42dbf26 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2003-11-17  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Maciej
+
+	Fix for this bug:
+
+	<rdar://problem/3480023>: Links don't work if there's a colon in the URL
+
+	The colon in the URL was confusing KURL. I modified some checks in
+	KURL so that its search for schemes stops when a non-scheme 
+	character is found rather than when a path end segment character
+	is found.
+
+        * kwq/KWQKURL.mm: Added a new Colon class to the table of characters.
+        (isSchemeCharOrColon): New helper.
+        (KURL::KURL): Call on new helper when looking for a scheme.
+        (KURL::findHostnameInHierarchicalURL): Ditto.
+
 2003-11-17  David Hyatt  <hyatt at apple.com>
 
 	Fix for 2931829, lines with hyphens should break on the hyphens.  Match WinIE's behavior of
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index db77a97..dfdf2ce 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -46,28 +46,32 @@ typedef enum {
     // ( alpha | digit | "+" | "-" | "." )
     SchemeChar = 1 << 1,
 
+    // ":"
+    Colon = 1 << 2,
+    
     // mark        = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
     // unreserved  = alphanum | mark
     // ( unreserved | escaped | ";" | ":" | "&" | "=" | "+" | "$" | "," )
-    UserInfoChar = 1 << 2,
+    UserInfoChar = 1 << 3,
 
     // alnum | "." | "-" | "%"
     // The above is what the specification says, but we are lenient to
     // match existing practice and also allow:
     // "_"
-    HostnameChar = 1 << 3,
+    HostnameChar = 1 << 4,
 
     // hexdigit | ":" | "%"
-    IPv6Char = 1 << 4,
+    IPv6Char = 1 << 5,
 
     // "#" | "?" | "/" | nul
-    PathSegmentEndChar = 1 << 5,
+    PathSegmentEndChar = 1 << 6,
 
     // digit | "A" | "B" | "C" | "D" | "E" | "F" | "a" | "b" | "c" | "d" | "e" | "f"
-    HexDigitChar = 1 << 6,
+    HexDigitChar = 1 << 7,
 
     // not allowed in path
-    BadChar = 1 << 7
+    BadChar = 1 << 8
+
 } URLCharacterClasses;
 
 static const char hexDigits[17] = "0123456789ABCDEF";
@@ -102,7 +106,7 @@ static const unsigned char characterClassTable[256] = {
     /* 55  7 */ SchemeChar | UserInfoChar | HostnameChar | HexDigitChar | IPv6Char,
     /* 56  8 */ SchemeChar | UserInfoChar | HostnameChar | HexDigitChar | IPv6Char, 
     /* 57  9 */ SchemeChar | UserInfoChar | HostnameChar | HexDigitChar | IPv6Char,
-    /* 58  : */ UserInfoChar | IPv6Char,    /* 59  ; */ UserInfoChar,
+    /* 58  : */ Colon | UserInfoChar | IPv6Char,    /* 59  ; */ UserInfoChar,
     /* 60  < */ BadChar,    /* 61  = */ UserInfoChar,
     /* 62  > */ BadChar,    /* 63  ? */ PathSegmentEndChar | BadChar,
     /* 64  @ */ 0,
@@ -203,6 +207,7 @@ static int copyPathRemovingDots(char *dst, const char *src, int srcStart, int sr
 
 static inline bool isSchemeFirstChar(unsigned char c) { return characterClassTable[c] & SchemeFirstChar; }
 static inline bool isSchemeChar(unsigned char c) { return characterClassTable[c] & SchemeChar; }
+static inline bool isSchemeCharOrColon(unsigned char c) { return characterClassTable[c] & (SchemeChar | Colon); }
 static inline bool isUserInfoChar(unsigned char c) { return characterClassTable[c] & UserInfoChar; }
 static inline bool isHostnameChar(unsigned char c) { return characterClassTable[c] & HostnameChar; }
 static inline bool isIPv6Char(unsigned char c) { return characterClassTable[c] & IPv6Char; }
@@ -286,7 +291,7 @@ KURL::KURL(const KURL &base, const QString &relative, const QTextCodec *codec)
             QString protocol;
             for (uint i = 0; i < relative.length(); i++) {
                 char p = relative.at(i).latin1();
-                if (isPathSegmentEndChar(p)) {
+                if (!isSchemeCharOrColon(p)) {
                     break;
                 }
                 if (p == ':') {
@@ -319,7 +324,7 @@ KURL::KURL(const KURL &base, const QString &relative, const QTextCodec *codec)
     // indicate no scheme had been found. isPathSegmentEndChar
     // tests for those three characters or NULL.
 
-    for (const char *p = str; !isPathSegmentEndChar(*p); ++p) {
+    for (const char *p = str; isSchemeCharOrColon(*p); ++p) {
 	if (*p == ':') {
 	    absolute = true;
 	    break;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list