Last modified: 2012-08-28 20:35:08 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40805, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38805 - JavaScript exception thrown by decodeURI on SpecialBannerController should be caught
JavaScript exception thrown by decodeURI on SpecialBannerController should be...
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
master
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 25846 33098 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-29 21:55 UTC by TMg
Modified: 2012-08-28 20:35 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description TMg 2012-07-29 21:55:52 UTC
The file:

mediawiki/extensions/CentralNotice/special/SpecialBannerController.php

may crash with a "Malformed URI" exception when executing the line:

return decodeURIComponent( s.split( '+' ).join( ' ' ) );

Here is a very simple example to trigger this error:

http://de.wikipedia.org/w/index.php?title=Wikipedia:CentralNotice&action=edit&summary=%E4

I know, this *is* a malformed URI (it's not UTF-8). Thats not the problem. The problem is: This stops *all* other scripts including the WikiEditor. This is why I consider this a "blocker".

Expected behavior: The CentralNotice extension should never interfere with other scripts, not even if there *is* an error.

Solution: decodeURI and decodeURIComponent must *always* be surrounded by a try-catch block.

https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/CentralNotice.git;a=blame;f=special/SpecialBannerController.php;h=531072f79f22a6797070a6828284f91114f515ff;hb=HEAD
Comment 1 Marius Hoch 2012-07-29 22:18:58 UTC
Fixed in Icab22e6e858e95c8197f51f72d958608a87d6fd5 (that is the only use of decodeURIComponent within the extension)
Comment 2 Marius Hoch 2012-07-29 22:26:37 UTC
Fix has been merged
Comment 3 Michael M. 2012-07-30 07:36:27 UTC
*** Bug 33098 has been marked as a duplicate of this bug. ***
Comment 4 Fomafix 2012-08-28 20:35:08 UTC
*** Bug 25846 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links