Index: trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js |
— | — | @@ -107,7 +107,7 @@ |
108 | 108 | }); |
109 | 109 | |
110 | 110 | test( 'getParamValue', function() { |
111 | | - expect(4); |
| 111 | + expect(5); |
112 | 112 | |
113 | 113 | var url1 = 'http://mediawiki.org/?foo=wrong&foo=right#&foo=bad'; |
114 | 114 | |
— | — | @@ -119,6 +119,9 @@ |
120 | 120 | |
121 | 121 | var url3 = 'example.com?' + $.param({ 'TEST': 'a b+c' }); |
122 | 122 | strictEqual( mw.util.getParamValue( 'TEST', url3 ), 'a b+c', 'Bug 30441: getParamValue must understand "+" encoding of space' ); |
| 123 | + |
| 124 | + var url4 = 'example.com?' + $.param({ 'TEST': 'a b+c d' }); // check for sloppy code from r95332 :) |
| 125 | + strictEqual( mw.util.getParamValue( 'TEST', url4 ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' ); |
123 | 126 | }); |
124 | 127 | |
125 | 128 | test( 'tooltipAccessKey', function() { |
Index: trunk/phase3/resources/mediawiki/mediawiki.util.js |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | if ( m && m.length > 1 ) { |
230 | 230 | // Beware that decodeURIComponent is not required to understand '+' |
231 | 231 | // by spec, as encodeURIComponent does not produce it. |
232 | | - return decodeURIComponent( m[1].replace( '+', '%20' ) ); |
| 232 | + return decodeURIComponent( m[1].replace( /\+/g, '%20' ) ); |
233 | 233 | } |
234 | 234 | return null; |
235 | 235 | }, |