Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include.postload.js

Issue 4567408790470656: Issue 1393 - Block element dialog suggests decoded URLs (Closed)
Patch Set: Created Sept. 18, 2014, 3:10 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -387,6 +387,7 @@
// Does some degree of URL normalization
function normalizeURL(url)
{
+ url = encodeURI(url);
Wladimir Palant 2014/09/18 18:53:02 What if the URL we get is already encoded? This fu
Sebastian Noack 2014/09/19 10:13:32 Thomas, can you please explain / figure out why th
Thomas Greiner 2014/09/19 10:47:13 Now I see what you mean. Element.src does give us
Sebastian Noack 2014/09/19 11:14:50 Yes, .src always returns a quoted URL no matter ho
Wladimir Palant 2014/09/21 18:37:42 The other advantage here is that element.src retur
Thomas Greiner 2014/09/22 09:37:33 I didn't find any reason against applying it to ob
var components = url.match(/(.+:\/\/.+?)\/(.*)/);
if(!components)
return url;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld