Title: [151918] trunk/Source/WebInspectorUI
Revision
151918
Author
grao...@apple.com
Date
2013-06-24 11:06:24 -0700 (Mon, 24 Jun 2013)

Log Message

Web Inspector: WebInspector.displayNameForURL() failure prevents DOM inspection
https://bugs.webkit.org/show_bug.cgi?id=117927

Handle possible mis-encoded URI fragments passed to decodeURIComponent() which
could prevent inspection of the DOM.

Reviewed by Timothy Hatcher.

* UserInterface/Main.js:
(WebInspector.displayNameForURL):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (151917 => 151918)


--- trunk/Source/WebInspectorUI/ChangeLog	2013-06-24 17:42:22 UTC (rev 151917)
+++ trunk/Source/WebInspectorUI/ChangeLog	2013-06-24 18:06:24 UTC (rev 151918)
@@ -1,3 +1,16 @@
+2013-06-24  Antoine Quint  <grao...@apple.com>
+
+        Web Inspector: WebInspector.displayNameForURL() failure prevents DOM inspection
+        https://bugs.webkit.org/show_bug.cgi?id=117927
+
+        Handle possible mis-encoded URI fragments passed to decodeURIComponent() which
+        could prevent inspection of the DOM.
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Main.js:
+        (WebInspector.displayNameForURL):
+
 2013-06-17  Darin Adler  <da...@apple.com>
 
         Sort all the Xcode project files

Modified: trunk/Source/WebInspectorUI/UserInterface/Main.js (151917 => 151918)


--- trunk/Source/WebInspectorUI/UserInterface/Main.js	2013-06-24 17:42:22 UTC (rev 151917)
+++ trunk/Source/WebInspectorUI/UserInterface/Main.js	2013-06-24 18:06:24 UTC (rev 151918)
@@ -353,7 +353,13 @@
 {
     if (!urlComponents)
         urlComponents = parseURL(url);
-    return decodeURIComponent(urlComponents.lastPathComponent || "") || WebInspector.displayNameForHost(urlComponents.host) || url;
+    var displayName;
+    try {
+        displayName = decodeURIComponent(urlComponents.lastPathComponent || "");
+    } catch (e) {
+        displayName = urlComponents.lastPathComponent;
+    }
+    return displayName || WebInspector.displayNameForHost(urlComponents.host) || url;
 }
 
 WebInspector.displayNameForHost = function(host)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to