Page MenuHomePhabricator

Weird problem with some characters on [[MediaWiki:Gadgets-definition‎]]
Closed, DeclinedPublic

Description

Big annoying bug with Gadgets extension

The problem I've mentioned on bug 28215 comment 7 reappeared, and this time I was able to find some way to reproduce it!

I've created a simple [[MediaWiki:Gadget-A.js]] with

var test = 'ok';

and then added it to [[MediaWiki:Gadgets-definition‎]] with "something" like this:

*A‎‎|A.js‎‎

and then nothing was displayed on [[Special:Gadgets]]. I didn't know why it didn't show up, so I've made some tests...

At some point I decided to type the "same" text again and it suddenly started to work, which I found very weird, because the diff was showing two pages with apparently the same content. Since the diffs ignore spaces and some other characteres, I decided to check exactly which characteres were in the editbox in the version of the page which didn't load the gadget. To do that, I wrote the following in the console of my browser:

var str = $('#wpTextbox1').val();
for (i=0;i<str.length;i++){
   console.debug( "'"
       + str.charAt(i) + "'\t'"
       + str.charCodeAt(i) + "'"
   );
}

You can check the result in the attached image.
So, indeed there was some invisible character between A and |, whose char code is 8206 (what is that? how did that ended up in the page?).

So, it would be really really cool if the code of the extension could check of such strange characters in the [[MediaWiki:Gadgets-definition]] page, and either filter them out or display some warning, so that people don't need to fight against such an odd bug again.

For the record, here is the log of the first round of the fight:
https://secure.wikimedia.org/wikibooks/pt/w/index.php?title=MediaWiki:Gadgets-definition&offset=20110301000000&limit=21&action=history
(spoiler: the bug wins! =)


Attached:

Weeeeird_bug_with_gadgets.png (768×1 px, 120 KB)

Details

Reference
bz29794

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:34 PM
bzimport set Reference to bz29794.

It's U+200E LEFT-TO-RIGHT MARK. Very annoying little beasts that mystically appear near pipe symbols.

Hmm, could be done. Direction marks, non-breakable space, anything else worth ignoring?

Marking wontfix. Patches are welcome, but this definition method is removed in the 2.0 branch, naturally making it impossible for these kind of issues to occur.