Title: [152501] branches/safari-537-branch/Source/WebInspectorUI
- Revision
- 152501
- Author
- [email protected]
- Date
- 2013-07-09 11:03:21 -0700 (Tue, 09 Jul 2013)
Log Message
Merged r152380. <rdar://problem/14340027>
Modified Paths
Diff
Modified: branches/safari-537-branch/Source/WebInspectorUI/ChangeLog (152500 => 152501)
--- branches/safari-537-branch/Source/WebInspectorUI/ChangeLog 2013-07-09 18:00:54 UTC (rev 152500)
+++ branches/safari-537-branch/Source/WebInspectorUI/ChangeLog 2013-07-09 18:03:21 UTC (rev 152501)
@@ -1,3 +1,22 @@
+2013-07-09 Lucas Forschler <[email protected]>
+
+ Merge r152380
+
+ 2013-07-03 Timothy Hatcher <[email protected]>
+
+ Guard remaining calls to decodeURIComponent with a try/catch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=118371
+
+ Reviewed by Joseph Pecoraro.
+
+ * UserInterface/Main.js:
+ (WebInspector.displayNameForURL):
+ (WebInspector.updateWindowTitle):
+ * UserInterface/Utilities.js:
+ (arrayResult):
+ (queryString):
+
2013-07-02 Lucas Forschler <[email protected]>
Merge r152199
Modified: branches/safari-537-branch/Source/WebInspectorUI/UserInterface/Main.js (152500 => 152501)
--- branches/safari-537-branch/Source/WebInspectorUI/UserInterface/Main.js 2013-07-09 18:00:54 UTC (rev 152500)
+++ branches/safari-537-branch/Source/WebInspectorUI/UserInterface/Main.js 2013-07-09 18:03:21 UTC (rev 152501)
@@ -357,12 +357,14 @@
{
if (!urlComponents)
urlComponents = parseURL(url);
+
var displayName;
try {
displayName = decodeURIComponent(urlComponents.lastPathComponent || "");
} catch (e) {
displayName = urlComponents.lastPathComponent;
}
+
return displayName || WebInspector.displayNameForHost(urlComponents.host) || url;
}
@@ -377,14 +379,22 @@
var mainFrame = this.frameResourceManager.mainFrame;
console.assert(mainFrame);
+ var urlComponents = mainFrame.mainResource.urlComponents;
+
+ var lastPathComponent;
+ try {
+ lastPathComponent = decodeURIComponent(urlComponents.lastPathComponent || "");
+ } catch (e) {
+ lastPathComponent = urlComponents.lastPathComponent;
+ }
+
// Build a title based on the URL components.
- var urlComponents = mainFrame.mainResource.urlComponents;
- if (urlComponents.host && urlComponents.lastPathComponent)
- var title = this.displayNameForHost(urlComponents.host) + " \u2014 " + decodeURIComponent(urlComponents.lastPathComponent);
+ if (urlComponents.host && lastPathComponent)
+ var title = this.displayNameForHost(urlComponents.host) + " \u2014 " + lastPathComponent;
else if (urlComponents.host)
var title = this.displayNameForHost(urlComponents.host);
- else if (urlComponents.lastPathComponent)
- var title = decodeURIComponent(urlComponents.lastPathComponent);
+ else if (lastPathComponent)
+ var title = lastPathComponent;
else
var title = mainFrame.url;
Modified: branches/safari-537-branch/Source/WebInspectorUI/UserInterface/Utilities.js (152500 => 152501)
--- branches/safari-537-branch/Source/WebInspectorUI/UserInterface/Utilities.js 2013-07-09 18:00:54 UTC (rev 152500)
+++ branches/safari-537-branch/Source/WebInspectorUI/UserInterface/Utilities.js 2013-07-09 18:03:21 UTC (rev 152501)
@@ -1170,8 +1170,12 @@
function decode(string)
{
- // Replace "+" with " " then decode precent encoded values.
- return decodeURIComponent(string.replace(/\+/g, " "));
+ try {
+ // Replace "+" with " " then decode precent encoded values.
+ return decodeURIComponent(string.replace(/\+/g, " "));
+ } catch (e) {
+ return string;
+ }
}
var parameters = arrayResult ? [] : {};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes