Percent-encode spaces in URLs, so that they are recognized as valid URLs later

on.
This commit is contained in:
Gabriel Wicke 2012-03-08 11:53:15 +00:00
parent 7518db8197
commit 39017dd769
Notes: Gabriel Wicke 2012-03-08 11:53:15 +00:00

View file

@ -280,7 +280,7 @@ MWParserEnvironment.prototype.sanitizeURI = function ( s ) {
host = host.replace( /%(?![0-9a-fA-F][0-9a-fA-F])|[#|]/g, function ( m ) {
return encodeURIComponent( m );
} );
path = path.replace( /%(?![0-9a-fA-F][0-9a-fA-F])|[\[\]#|]/g, function ( m ) {
path = path.replace( /%(?![0-9a-fA-F][0-9a-fA-F])|[ \[\]#|]/g, function ( m ) {
return encodeURIComponent( m );
} );
s = host + path;