Page MenuHomePhabricator

JS error "malformed URI sequence" in Special:BannerController
Closed, ResolvedPublic

Description

Although the URL
http://pt.wikibooks.org/w/index.php?title=Especial:Contribuições&uselang=en
works without JS errors, this one causes "malformed URI sequence":
http://pt.wikibooks.org/w/index.php?title=Especial:Contribui%E7%F5es&uselang=en

Firebug shows this:

malformed URI sequence
http://pt.wikibooks.org/w/index.php?title=Especial:BannerController&cache=/cn.js&283-6

Line 96

the line 96 in question is

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


Version: unspecified
Severity: minor
URL: http://pt.wikibooks.org/w/index.php?title=Especial:Contribui%E7%F5es&uselang=en
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=31918

Details

Reference
bz25846

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 11:15 PM
bzimport set Reference to bz25846.
bzimport added a subscriber: Unknown Object (MLST).

How did you get that 2nd form of the url ? Because it is indeed incorrect.

The proper form of the encoded variant of the first url is:
http://pt.wikibooks.org/w/index.php?title=Especial%3AContribui%C3%A7%C3%B5es&uselang=en

The 2nd form was created using escape() instead of encodeURIComponent, and escape() does not support UTF-8.

It appears that the bug is in whatever code generated the 2nd URL.

(In reply to comment #1)

How did you get that 2nd form of the url ? Because it is indeed incorrect.

I just did this:

  • Clicked in the first link (browser used: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729))
  • Copied the URL shown in the address bar
  • Paste it here (or any any wiki)

The problem didn't happens using Internet Explorer 8.0.6001.18702. Maybe it is a Firefox bug?

(In reply to comment #3)

(In reply to comment #1)

How did you get that 2nd form of the url ? Because it is indeed incorrect.

I just did this:

  • Clicked in the first link (browser used: Mozilla/5.0 (Windows; U; Windows NT

5.1; pt-BR; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729))

  • Copied the URL shown in the address bar
  • Paste it here (or any any wiki)

My mistake. This yelds the URL:
http://pt.wikibooks.org/w/index.php?title=Especial:Contribui%C3%A7%C3%B5es&uselang=en
Marking again as invalid (until I can reproduce it again...)

I was able to reproduce this again today:

  1. Go to the recent changes of Portuguese Wikipedia

https://secure.wikimedia.org/wikipedia/pt/wiki/Especial:Mudanças_recentes?uselang=en

  1. Click on "Show ... [500] changes"

https://secure.wikimedia.org/wikipedia/pt/w/index.php?title=Especial:Mudan%C3%A7as_recentes&limit=500

  1. In the URL shown in the address bar, change 500 to 50 and press ENTER.

When I do this, using Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3, with an empty /common.js and no Gadgets enabled, I get:

Erro: malformed URI sequence
Arquivo-fonte: https://secure.wikimedia.org/wikipedia/pt/w/index.php?title=Especial:BannerController&cache=/cn.js&301-3

Linha: 111

(In reply to comment #5)

  1. Click on "Show ... [500] changes"

https://secure.wikimedia.org/wikipedia/pt/w/index.php?title=Especial:Mudan%C3%A7as_recentes&limit=500

  1. In the URL shown in the address bar, change 500 to 50 and press ENTER.

PS: You can start from the second step, clicking in the url above and then change 500 to 50 after the page is loaded.

The error also occurs if I'm not logged in.

And do not happens using Google Chrome 12.0.742.112 on Microsoft Windows Version 5.1 (2600.xpsp_3_gdr.101209-1647: Service Pack 3).

I was not able to reproduce the bug using the steps specified in either Firefox 6 or Firefox 3.

Created attachment 9220
The error

(In reply to comment #9)

I was not able to reproduce the bug using the steps specified in either Firefox
6 or Firefox 3.

I just confirmed it still happens under Windows XP Professional, using Firefox 4.0 and disabling every addon in my browser (see screenshot).

The error also happens on
https://pt.wikipedia.org/w/index.php?title=Especial:Mudan%E7as_recentes&limit=50
and on
http://pt.wikipedia.org/w/index.php?title=Especial:Mudan%E7as_recentes&limit=50

Attached:

bug_25846.PNG (870×1 px, 197 KB)

richw wrote:

I'm experiencing the same problem, I believe, involving the following diff URL in en.wiki:

http://en.wikipedia.org/w/index.php?title=Charles_Andr%A9_Julien&diff=495291312&oldid=494889006

In addition to causing a "malformed URI sequence" error in Special:BannerController, attempts to hover over this same URL in a document causes a similar error in the "Popups" gadget. See here for more details:

http://en.wikipedia.org/w/index.php?title=MediaWiki_talk%3AGadget-popups.js&diff=495521364&oldid=492571660

I'm guessing the problem is because "%A9" is not the correct UTF-8 coding for e-acute; it should be "%C3%A9". But it would be nice if this sort of thing could be caught more cleanly.

I'm running Firefox 12.0 on Ubuntu 11.04 (Natty).

The error in the BannerController is catched by Bug 38805 / Change-Id: Icab22e6e858e95c8197f51f72d958608a87d6fd5

The general problem of decoding ISO 8859-1 characters from URL for Bug 31918 is still not fixed.

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