Merge "ApiSandbox: Convert all pluses in URL to spaces, not just the first one"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 25 Feb 2016 13:46:36 +0000 (13:46 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 25 Feb 2016 13:46:36 +0000 (13:46 +0000)
resources/src/mediawiki.special/mediawiki.special.apisandbox.js

index bd1cad6..06d1538 100644 (file)
 
                        // I'm surprised this doesn't seem to exist in jQuery or mw.util.
                        params = {};
-                       hash = hash.replace( '+', '%20' );
+                       hash = hash.replace( /\+/g, '%20' );
                        re = /([^&=#]+)=?([^&#]*)/g;
                        while ( ( m = re.exec( hash ) ) ) {
                                params[ decodeURIComponent( m[ 1 ] ) ] = decodeURIComponent( m[ 2 ] );