if ( m && m.length > 1 ) {
// Beware that decodeURIComponent is not required to understand '+'
// by spec, as encodeURIComponent does not produce it.
- return decodeURIComponent( m[1].replace( '+', '%20' ) );
+ return decodeURIComponent( m[1].replace( /\+/g, '%20' ) );
}
return null;
},
});
test( 'getParamValue', function() {
- expect(4);
+ expect(5);
var url1 = 'http://mediawiki.org/?foo=wrong&foo=right#&foo=bad';
var url3 = 'example.com?' + $.param({ 'TEST': 'a b+c' });
strictEqual( mw.util.getParamValue( 'TEST', url3 ), 'a b+c', 'Bug 30441: getParamValue must understand "+" encoding of space' );
+
+ var url4 = 'example.com?' + $.param({ 'TEST': 'a b+c d' }); // check for sloppy code from r95332 :)
+ strictEqual( mw.util.getParamValue( 'TEST', url4 ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' );
});
test( 'tooltipAccessKey', function() {