Correct mw.Uri.decode to properly decode encoded + signs. Fixes bug 33902
authorDerk-Jan Hartman <hartman@users.mediawiki.org>
Mon, 23 Jan 2012 18:11:28 +0000 (18:11 +0000)
committerDerk-Jan Hartman <hartman@users.mediawiki.org>
Mon, 23 Jan 2012 18:11:28 +0000 (18:11 +0000)
Patch by Fomafix

RELEASE-NOTES-1.19
resources/mediawiki/mediawiki.Uri.js

index 1a2eeb3..4180a1c 100644 (file)
@@ -233,6 +233,7 @@ production.
   a null edit.
 * (bug 33880) $wgUsersNotifiedOnAllChanges should not send e-mail to user who made
   the edit.
+* (bug 33902) Decoding %2B with mw.Uri.decode results in ' ' instead of +
 
 === API changes in 1.19 ===
 * Made action=edit less likely to return "unknownerror", by returning the actual error
index 21d70cc..26fdfa9 100644 (file)
                 * @return {String} decoded string
                 */
                Uri.decode = function( s ) {
-                       return decodeURIComponent( s ).replace( /\+/g, ' ' );
+                       return decodeURIComponent( s.replace( /\+/g, '%20' ) );
                };
 
                Uri.prototype = {