[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 07:01:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c911ccf5481739040af433165c35121ce38de471
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 15 18:22:01 2002 +0000

    	Remove characters RFC 2396 describes as "unwise" from the
    	BadChar character class. This causes them to remain unescaped
    	in KURL objects. As a result, some extra escaping needed to
    	be added into the getNSURL() function to enable NSURL
    	objects to be created using a KURL.
    
    	This enables me to fix this bug:
    	Radar 3050437 (Clicking link leads to page with garbled content)
    
    	Note, however, that my fix for 3050437 relies on this bug remaining unfixed:
    
    	Radar 3102332 (Square bracket characters "sneak through" CFURL illegal character checks)
    
            * kwq/KWQKURL.mm:
            (KURL::getNSURL)
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2693 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 017ecb5..47a8cbb 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,21 @@
+2002-11-15  Ken Kocienda  <kocienda at apple.com>
+
+	Remove characters RFC 2396 describes as "unwise" from the
+	BadChar character class. This causes them to remain unescaped
+	in KURL objects. As a result, some extra escaping needed to 
+	be added into the getNSURL() function to enable NSURL 
+	objects to be created using a KURL.
+
+	This enables me to fix this bug:
+	Radar 3050437 (Clicking link leads to page with garbled content)
+
+	Note, however, that my fix for 3050437 relies on this bug remaining unfixed:
+
+	Radar 3102332 (Square bracket characters "sneak through" CFURL illegal character checks)
+
+        * kwq/KWQKURL.mm:
+        (KURL::getNSURL)
+
 2002-11-15  Darin Adler  <darin at apple.com>
 
 	- fixed 3027460 -- text areas don't have focus rectangles
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 017ecb5..47a8cbb 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,21 @@
+2002-11-15  Ken Kocienda  <kocienda at apple.com>
+
+	Remove characters RFC 2396 describes as "unwise" from the
+	BadChar character class. This causes them to remain unescaped
+	in KURL objects. As a result, some extra escaping needed to 
+	be added into the getNSURL() function to enable NSURL 
+	objects to be created using a KURL.
+
+	This enables me to fix this bug:
+	Radar 3050437 (Clicking link leads to page with garbled content)
+
+	Note, however, that my fix for 3050437 relies on this bug remaining unfixed:
+
+	Radar 3102332 (Square bracket characters "sneak through" CFURL illegal character checks)
+
+        * kwq/KWQKURL.mm:
+        (KURL::getNSURL)
+
 2002-11-15  Darin Adler  <darin at apple.com>
 
 	- fixed 3027460 -- text areas don't have focus rectangles
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 017ecb5..47a8cbb 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,21 @@
+2002-11-15  Ken Kocienda  <kocienda at apple.com>
+
+	Remove characters RFC 2396 describes as "unwise" from the
+	BadChar character class. This causes them to remain unescaped
+	in KURL objects. As a result, some extra escaping needed to 
+	be added into the getNSURL() function to enable NSURL 
+	objects to be created using a KURL.
+
+	This enables me to fix this bug:
+	Radar 3050437 (Clicking link leads to page with garbled content)
+
+	Note, however, that my fix for 3050437 relies on this bug remaining unfixed:
+
+	Radar 3102332 (Square bracket characters "sneak through" CFURL illegal character checks)
+
+        * kwq/KWQKURL.mm:
+        (KURL::getNSURL)
+
 2002-11-15  Darin Adler  <darin at apple.com>
 
 	- fixed 3027460 -- text areas don't have focus rectangles
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index 9c011b9..7b68f07 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -120,11 +120,11 @@ static const unsigned char characterClassTable[256] = {
     /* 88  X */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
     /* 89  Y */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
     /* 90  Z */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
-    /* 91  [ */ BadChar,
-    /* 92  \ */ BadChar,    /* 93  ] */ BadChar,
-    /* 94  ^ */ BadChar,
+    /* 91  [ */ 0,
+    /* 92  \ */ 0,    /* 93  ] */ 0,
+    /* 94  ^ */ 0,
     /* 95  _ */ UserInfoChar | HostnameChar,
-    /* 96  ` */ BadChar,
+    /* 96  ` */ 0,
     /* 97  a */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | HexDigitChar | IPv6Char,
     /* 98  b */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | HexDigitChar | IPv6Char, 
     /* 99  c */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar | HexDigitChar | IPv6Char,
@@ -151,8 +151,8 @@ static const unsigned char characterClassTable[256] = {
     /* 120  x */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
     /* 121  y */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar,
     /* 122  z */ SchemeFirstChar | SchemeChar | UserInfoChar | HostnameChar, 
-    /* 123  { */ BadChar,
-    /* 124  | */ BadChar,   /* 125  } */ BadChar,   /* 126  ~ */ UserInfoChar,   /* 127 del */ BadChar,
+    /* 123  { */ 0,
+    /* 124  | */ 0,   /* 125  } */ 0,   /* 126  ~ */ UserInfoChar,   /* 127 del */ BadChar,
     /* 128 */ BadChar, /* 129 */ BadChar, /* 130 */ BadChar, /* 131 */ BadChar,
     /* 132 */ BadChar, /* 133 */ BadChar, /* 134 */ BadChar, /* 135 */ BadChar,
     /* 136 */ BadChar, /* 137 */ BadChar, /* 138 */ BadChar, /* 139 */ BadChar,
@@ -1065,7 +1065,20 @@ NSURL *KURL::getNSURL() const
         string = [NSString stringWithFormat:@"file://%@", [string substringFromIndex:5]];
     }
     
-    return [NSURL URLWithString:string];
+    NSURL *URL = [NSURL URLWithString:string];
+    if (!URL) {
+        // Try to create URL again, but this time do some more string escaping first.
+        // Eventually, we would prefer not to have to take this extra step, as the extra
+        // escaping causes bugs like 3064743.
+        // Note the set of unescaped characters contains the square brackets.
+        // This is a bit of license we take with CFURL and its code to detect characters
+        // it considers illegal. See 3102332 for more information.
+        CFStringRef stricterString = CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)string, CFSTR("[]%"), NULL, kCFStringEncodingUTF8);
+        URL = [NSURL URLWithString:(NSString *)stricterString];
+        CFRelease(stricterString);
+    }
+    
+    return URL;
 }
 
 QString KURL::encodedHtmlRef() const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list