From: Matt Russell Date: Thu, 25 Feb 2016 07:19:38 +0000 (+1100) Subject: ApiSandbox: Convert all pluses in URL to spaces, not just the first one X-Git-Tag: 1.31.0-rc.0~7840^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=65bc5487e908dd7683d5c6f97156f73a0b3c4f91;p=lhc%2Fweb%2Fwiklou.git ApiSandbox: Convert all pluses in URL to spaces, not just the first one This would prevent linking to any query that contains spaces. Change-Id: I45607c1eb465d4d9bf7bbb1de7098bb1450b5043 Bug: T128053 --- diff --git a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js index bd1cad6bb9..06d1538418 100644 --- a/resources/src/mediawiki.special/mediawiki.special.apisandbox.js +++ b/resources/src/mediawiki.special/mediawiki.special.apisandbox.js @@ -695,7 +695,7 @@ // 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 ] );