[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
mjs
mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:01:17 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1671b85bd7e914d1a8091aab55697fabb7fd135e
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Apr 3 13:35:37 2002 +0000
Top level:
* Tests/kde/kurl-test.chk, Tests/kde/kurl-test.cpp: Added test
cases to check that Radar 2893298 (KURL rejects spaces and other
illegal but unambiguous characters, leading to load failures) is
fixed.
WebCore:
Fixed Radar 2893298 (KURL rejects spaces and other illegal but
unambiguous characters, leading to load failures).
* src/kwq/KWQKURL.mm: (KURL::KWQKURLPrivate::makeRef,
KURL::normalizeRelativeURLString): Escape forbidden characters
(ones that are never legal in a URL), except '#' (since that can
start a fragment identifier) and '%'
(since that can be the start of a valid escape sequence).
(KURL::KWQKURLPrivate::KWQKURLPrivate,
KURL::KWQKURLPrivate::compose): out of paranoia, make sure urlRef
is set to NULL if not a valid value.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 900ce48..368086e 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,20 @@
2002-04-03 Maciej Stachowiak <mjs at apple.com>
+ Fixed Radar 2893298 (KURL rejects spaces and other illegal but
+ unambiguous characters, leading to load failures).
+
+ * src/kwq/KWQKURL.mm: (KURL::KWQKURLPrivate::makeRef,
+ KURL::normalizeRelativeURLString): Escape forbidden characters
+ (ones that are never legal in a URL), except '#' (since that can
+ start a fragment identifier) and '%'
+ (since that can be the start of a valid escape sequence).
+
+ (KURL::KWQKURLPrivate::KWQKURLPrivate,
+ KURL::KWQKURLPrivate::compose): out of paranoia, make sure urlRef
+ is set to NULL if not a valid value.
+
+2002-04-03 Maciej Stachowiak <mjs at apple.com>
+
* src/kwq/kwqdebug.mm: (KWQGetLogLevel): Allocate and release
NSScanner instead of using an autoreleased one, to fix Jersey
redness whereby the regression tests leak.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 900ce48..368086e 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,20 @@
2002-04-03 Maciej Stachowiak <mjs at apple.com>
+ Fixed Radar 2893298 (KURL rejects spaces and other illegal but
+ unambiguous characters, leading to load failures).
+
+ * src/kwq/KWQKURL.mm: (KURL::KWQKURLPrivate::makeRef,
+ KURL::normalizeRelativeURLString): Escape forbidden characters
+ (ones that are never legal in a URL), except '#' (since that can
+ start a fragment identifier) and '%'
+ (since that can be the start of a valid escape sequence).
+
+ (KURL::KWQKURLPrivate::KWQKURLPrivate,
+ KURL::KWQKURLPrivate::compose): out of paranoia, make sure urlRef
+ is set to NULL if not a valid value.
+
+2002-04-03 Maciej Stachowiak <mjs at apple.com>
+
* src/kwq/kwqdebug.mm: (KWQGetLogLevel): Allocate and release
NSScanner instead of using an autoreleased one, to fix Jersey
redness whereby the regression tests leak.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 900ce48..368086e 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,20 @@
2002-04-03 Maciej Stachowiak <mjs at apple.com>
+ Fixed Radar 2893298 (KURL rejects spaces and other illegal but
+ unambiguous characters, leading to load failures).
+
+ * src/kwq/KWQKURL.mm: (KURL::KWQKURLPrivate::makeRef,
+ KURL::normalizeRelativeURLString): Escape forbidden characters
+ (ones that are never legal in a URL), except '#' (since that can
+ start a fragment identifier) and '%'
+ (since that can be the start of a valid escape sequence).
+
+ (KURL::KWQKURLPrivate::KWQKURLPrivate,
+ KURL::KWQKURLPrivate::compose): out of paranoia, make sure urlRef
+ is set to NULL if not a valid value.
+
+2002-04-03 Maciej Stachowiak <mjs at apple.com>
+
* src/kwq/kwqdebug.mm: (KWQGetLogLevel): Allocate and release
NSScanner instead of using an autoreleased one, to fix Jersey
redness whereby the regression tests leak.
diff --git a/WebCore/kwq/KWQKURL.mm b/WebCore/kwq/KWQKURL.mm
index 018eb23..3ab3b74 100644
--- a/WebCore/kwq/KWQKURL.mm
+++ b/WebCore/kwq/KWQKURL.mm
@@ -61,7 +61,7 @@ public:
KURL::KWQKURLPrivate::KWQKURLPrivate(const QString &url) :
- urlRef(nil),
+ urlRef(NULL),
iPort(0),
addedSlash(false),
refCount(0)
@@ -127,7 +127,14 @@ void KURL::KWQKURLPrivate::makeRef()
addedSlash = false;
}
- urlRef = CFURLCreateWithString(NULL, sURLMaybeAddSlash.getCFMutableString(), NULL);
+ // Escape illegal but unambiguous characters that are actually
+ // found on the web in URLs, like ' ' or '|'
+ CFStringRef escaped = CFURLCreateStringByAddingPercentEscapes(NULL, sURLMaybeAddSlash.getCFMutableString(),
+ CFSTR("%#"), NULL, kCFStringEncodingUTF8);
+
+ urlRef = CFURLCreateWithString(NULL, escaped, NULL);
+
+ CFRelease(escaped);
}
static inline QString CFStringToQString(CFStringRef cfs)
@@ -270,6 +277,7 @@ void KURL::KWQKURLPrivate::compose()
if (urlRef != NULL) {
CFRelease(urlRef);
+ urlRef = NULL;
}
sURL = result;
@@ -438,19 +446,22 @@ QString KURL::normalizeRelativeURLString(const KURL &base, const QString &relati
} else {
base.parse();
- CFStringRef relativeURLString = relative.getCFMutableString();
-
+ CFStringRef relativeURLString;
+ CFStringRef escapedString = CFURLCreateStringByAddingPercentEscapes(NULL, relative.getCFMutableString(),
+ CFSTR("%#"), NULL, kCFStringEncodingUTF8);
+
// Workaround for CFURL bug with colons, Radar 2891336.
- bool hideColons = needToHideColons(relativeURLString);
+ bool hideColons = needToHideColons(escapedString );
if (hideColons) {
- relativeURLString = copyAndReplaceAll(relativeURLString, CFSTR(":"), CFSTR("INTRIGUE_COLON"));
- }
+ relativeURLString = copyAndReplaceAll(escapedString, CFSTR(":"), CFSTR("INTRIGUE_COLON"));
+ CFRelease(escapedString);
+ } else {
+ relativeURLString = escapedString;
+ }
CFURLRef relativeURL = CFURLCreateWithString(NULL, relativeURLString, base.d->urlRef);
- if (hideColons) {
- CFRelease(relativeURLString);
- }
+ CFRelease(relativeURLString);
if (relativeURL == NULL) {
result = normalizeURLString(relative);
diff --git a/WebCore/src/kwq/KWQKURL.mm b/WebCore/src/kwq/KWQKURL.mm
index 018eb23..3ab3b74 100644
--- a/WebCore/src/kwq/KWQKURL.mm
+++ b/WebCore/src/kwq/KWQKURL.mm
@@ -61,7 +61,7 @@ public:
KURL::KWQKURLPrivate::KWQKURLPrivate(const QString &url) :
- urlRef(nil),
+ urlRef(NULL),
iPort(0),
addedSlash(false),
refCount(0)
@@ -127,7 +127,14 @@ void KURL::KWQKURLPrivate::makeRef()
addedSlash = false;
}
- urlRef = CFURLCreateWithString(NULL, sURLMaybeAddSlash.getCFMutableString(), NULL);
+ // Escape illegal but unambiguous characters that are actually
+ // found on the web in URLs, like ' ' or '|'
+ CFStringRef escaped = CFURLCreateStringByAddingPercentEscapes(NULL, sURLMaybeAddSlash.getCFMutableString(),
+ CFSTR("%#"), NULL, kCFStringEncodingUTF8);
+
+ urlRef = CFURLCreateWithString(NULL, escaped, NULL);
+
+ CFRelease(escaped);
}
static inline QString CFStringToQString(CFStringRef cfs)
@@ -270,6 +277,7 @@ void KURL::KWQKURLPrivate::compose()
if (urlRef != NULL) {
CFRelease(urlRef);
+ urlRef = NULL;
}
sURL = result;
@@ -438,19 +446,22 @@ QString KURL::normalizeRelativeURLString(const KURL &base, const QString &relati
} else {
base.parse();
- CFStringRef relativeURLString = relative.getCFMutableString();
-
+ CFStringRef relativeURLString;
+ CFStringRef escapedString = CFURLCreateStringByAddingPercentEscapes(NULL, relative.getCFMutableString(),
+ CFSTR("%#"), NULL, kCFStringEncodingUTF8);
+
// Workaround for CFURL bug with colons, Radar 2891336.
- bool hideColons = needToHideColons(relativeURLString);
+ bool hideColons = needToHideColons(escapedString );
if (hideColons) {
- relativeURLString = copyAndReplaceAll(relativeURLString, CFSTR(":"), CFSTR("INTRIGUE_COLON"));
- }
+ relativeURLString = copyAndReplaceAll(escapedString, CFSTR(":"), CFSTR("INTRIGUE_COLON"));
+ CFRelease(escapedString);
+ } else {
+ relativeURLString = escapedString;
+ }
CFURLRef relativeURL = CFURLCreateWithString(NULL, relativeURLString, base.d->urlRef);
- if (hideColons) {
- CFRelease(relativeURLString);
- }
+ CFRelease(relativeURLString);
if (relativeURL == NULL) {
result = normalizeURLString(relative);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list