[MediaWiki-CodeReview] [MediaWiki r95332]: New comment added, and revision status changed

2011-08-24 Thread MediaWiki Mail
User "Brion VIBBER" changed the status of MediaWiki.r95332.

Old Status: fixme
New Status: new

User "Brion VIBBER" also posted a comment on MediaWiki.r95332.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95332#c21433
Commit summary:

* (bug 30441) getParamValue must understand "+" encoding of space

$.param() produces query string form encoding using the traditional '+' 
encoding for space; mediawiki.util.getParamValue() was using only 
decodeURIComponent() to do unescaping, which is not required by spec to handle 
'+'. Explicitly replacing '+' with '%20' before the decode nicely resolves this.

Added a test case to qunit tests for mediawiki.util module.

Comment:

Fixed in r95451. Reset this rev to new for re-check.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview


[MediaWiki-CodeReview] [MediaWiki r95332]: New comment added, and revision status changed

2011-08-24 Thread MediaWiki Mail
User "Catrope" changed the status of MediaWiki.r95332.

Old Status: new
New Status: fixme

User "Catrope" also posted a comment on MediaWiki.r95332.

Full URL: 
https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Special:Code/MediaWiki/95332#c21374
Commit summary:

* (bug 30441) getParamValue must understand "+" encoding of space

$.param() produces query string form encoding using the traditional '+' 
encoding for space; mediawiki.util.getParamValue() was using only 
decodeURIComponent() to do unescaping, which is not required by spec to handle 
'+'. Explicitly replacing '+' with '%20' before the decode nicely resolves this.

Added a test case to qunit tests for mediawiki.util module.

Comment:


+   return decodeURIComponent( m[1].replace( '+', 
'%20' ) );

This doesn't work the way you expect. In JavaScript, .replace() 
only replaces the first occurrence, so:

>>> url3 = 'example.com?' + $.param({ 'TEST': 'a b+c d+e' });
"example.com?TEST=a+b%2Bc+d%2Be"
>>> mw.util.getParamValue( 'TEST', url3 )
"a b+c+d+e"

You'll need to use a regex with the g (global) modifier.

___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview