Changeset 152380 in webkit
- Timestamp:
- Jul 3, 2013 4:13:46 PM (11 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r152374 r152380 1 2013-07-03 Timothy Hatcher <timothy@apple.com> 2 3 Guard remaining calls to decodeURIComponent with a try/catch. 4 5 https://bugs.webkit.org/show_bug.cgi?id=118371 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Main.js: 10 (WebInspector.displayNameForURL): 11 (WebInspector.updateWindowTitle): 12 * UserInterface/Utilities.js: 13 (arrayResult): 14 (queryString): 15 1 16 2013-07-03 Jessie Berlin <jberlin@apple.com> 2 17 -
trunk/Source/WebInspectorUI/UserInterface/Main.js
r152141 r152380 358 358 if (!urlComponents) 359 359 urlComponents = parseURL(url); 360 360 361 var displayName; 361 362 try { … … 364 365 displayName = urlComponents.lastPathComponent; 365 366 } 367 366 368 return displayName || WebInspector.displayNameForHost(urlComponents.host) || url; 367 369 } … … 378 380 console.assert(mainFrame); 379 381 382 var urlComponents = mainFrame.mainResource.urlComponents; 383 384 var lastPathComponent; 385 try { 386 lastPathComponent = decodeURIComponent(urlComponents.lastPathComponent || ""); 387 } catch (e) { 388 lastPathComponent = urlComponents.lastPathComponent; 389 } 390 380 391 // Build a title based on the URL components. 381 var urlComponents = mainFrame.mainResource.urlComponents; 382 if (urlComponents.host && urlComponents.lastPathComponent) 383 var title = this.displayNameForHost(urlComponents.host) + " \u2014 " + decodeURIComponent(urlComponents.lastPathComponent); 392 if (urlComponents.host && lastPathComponent) 393 var title = this.displayNameForHost(urlComponents.host) + " \u2014 " + lastPathComponent; 384 394 else if (urlComponents.host) 385 395 var title = this.displayNameForHost(urlComponents.host); 386 else if ( urlComponents.lastPathComponent)387 var title = decodeURIComponent(urlComponents.lastPathComponent);396 else if (lastPathComponent) 397 var title = lastPathComponent; 388 398 else 389 399 var title = mainFrame.url; -
trunk/Source/WebInspectorUI/UserInterface/Utilities.js
r151453 r152380 1171 1171 function decode(string) 1172 1172 { 1173 // Replace "+" with " " then decode precent encoded values. 1174 return decodeURIComponent(string.replace(/\+/g, " ")); 1173 try { 1174 // Replace "+" with " " then decode precent encoded values. 1175 return decodeURIComponent(string.replace(/\+/g, " ")); 1176 } catch (e) { 1177 return string; 1178 } 1175 1179 } 1176 1180
Note: See TracChangeset
for help on using the changeset viewer.