Last modified: 2012-08-28 21:17:20 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 T35098, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 33098 - CentralNotice: decodeURIcomponent doesn't support bad unicode
CentralNotice: decodeURIcomponent doesn't support bad unicode
Status: RESOLVED DUPLICATE of bug 38805
Product: MediaWiki extensions
Classification: Unclassified
CentralNotice (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://commons.wikimedia.org/wiki/Spe...
: upstream
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-14 12:36 UTC by billinghurst
Modified: 2012-08-28 21:17 UTC (History)
6 users (show)

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


Attachments

Description billinghurst 2011-12-14 12:36:34 UTC
error occurring in page serving in Commons (secure login) as it just displays javascript file

When viewing pages one gets the error 
Error: https://commons.wikimedia.org/w/index.php?title=Special:BannerController&cache=/cn.js&303-4 at line 112: malformed URI sequence
Comment 1 Mark A. Hershberger 2011-12-14 16:57:55 UTC
[[Special:BannerController]] just serves up the same JS.  That doesn't seem right.

Do you still see the malformed URI sequence problems?  If so, which browser/OS?
Comment 2 Ryan Kaldari 2011-12-14 19:57:39 UTC
I haven't been able to reproduce this. Could you supply the following information:
* The URL on Commons where you are getting the error
* The language your account is set to
* The browser/OS you are using

Are you seeing this error consistently on every page of Commons or just certain ones?
Comment 3 Michael M. 2011-12-15 11:24:13 UTC
This happens in Firefox with strangly encoded urls. I can reproduce this with

http://en.wikipedia.org/w/index.php?title=%E6&action=historysubmit&diff=465013717&oldid=465013581

in Firefox 3.6.8.
Comment 4 billinghurst 2011-12-15 12:04:05 UTC
Hmm, I am seeing  "Error:Script error." tonight, though I am doing different maintenance tonight.  I see it on &action=delete pages, and I believe that last night it expanded it fuller to when you have bits set uselang=qqx

English

FF8.0, and same in Chrome

Cannot do more to track down this evening. :-/
Comment 5 Ryan Kaldari 2012-01-04 00:30:53 UTC
Michael M.: %E6 is incomplete multibyte character encoding. Where did you get that URL from? It should not exist.

billinghurst: action=delete and uselang=qqx both work fine for me. Can you give me a full URL?
Comment 6 Michael M. 2012-01-04 08:45:21 UTC
(In reply to comment #5)
> Michael M.: %E6 is incomplete multibyte character encoding. Where did you get
> that URL from? It should not exist.

I think it's not an incomplete Unicode character but a character encoded with ISO 8859-1 which is used by some old browsers (https://bugzilla.mozilla.org/show_bug.cgi?id=580381#c2 suggests that even Firefox 3.6.6 is one of the culprits). So such URLs are posted to the Village Pump / ... where they still work except the fact that decodeURIComponent throws an error.
Comment 7 Mark A. Hershberger 2012-01-04 20:13:09 UTC
As https://bugzilla.mozilla.org/show_bug.cgi?id=580381#c3 says:

  Yes, but all that means is that you can't use decodeURIComponent to decode
  that... because it's using the wrong character encoding.  You may be able to
  get away with window.unescape, but in general there's pretty much no support
  for working with arbitrary encodings (which is what you want here) built into
  the language.  You'd have to use a library that does that.

Any ideas?
Comment 8 Ryan Kaldari 2012-01-04 21:06:15 UTC
Yeah, I'm not really sure there's any way to solve this, as the JavaScript doesn't have any way to know what kind of encoding was used. If anyone has any ideas, let me know.
Comment 9 Mark A. Hershberger 2012-01-05 01:30:21 UTC
we need a library to decode arbitrary encodings... resolving LATER until someone writes one.
Comment 10 Michael M. 2012-01-05 08:09:09 UTC
Isn't it just possible to use mw.util.getParamValue ? This will throw an error too if there are bad unicode characters, but if you only call it for parameters with correctly encoded values it will work as expected.
Comment 11 Mark A. Hershberger 2012-01-06 16:44:13 UTC
(In reply to comment #10)
> Isn't it just possible to use mw.util.getParamValue ? This will throw an error
> too if there are bad unicode characters, but if you only call it for parameters
> with correctly encoded values it will work as expected.

The point is that the URL has bad Unicode characters.  Perhaps mw.util.getParamValue could be used in the end, but it would have to be changed to not throw an error.  If it found something that wasn't Unicode, it would have to try another encoding.
Comment 12 Michael M. 2012-01-07 09:52:21 UTC
The only URL parameters I can find in the source are banner and country. This problem only occurs since the whole URL is parsed, including strangely encoded parameters. mw.util.getParamValue just parses the parameters that are actually needed. If the CentralNotice doesn't care about the title parameter it wouldn't matter whether it is encoded in UTF8 or something else.
Comment 13 billinghurst 2012-01-07 10:26:02 UTC
@Mark A. Hershberger  I no longer have/get the error, though I am not seeing a special notice at all; so if things are still all being delivered the same at your end, maybe it was something in my common.js that was conflicting, though I have only had minor variations there.
Comment 14 Michael M. 2012-07-30 07:36:27 UTC
Reported again and fixed with a try-catch, so closing this as duplicate. Since those browsers that use encodings other than UTF-8 become more and more rarely, I don't think there is a need to try several encodings until the right one is found.

*** This bug has been marked as a duplicate of bug 38805 ***

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


Navigation
Links