[Mediawiki-l] curious little bug

Hiram Clawson hiram at soe.ucsc.edu
Wed Sep 17 19:00:18 UTC 2008


Good Morning MediaWiki Fans:

While working on an upgrade to 1.13.0 source, I noticed this
small anomaly in the system.  At line 1399 of includes/EditPage.php
there is the output statement:

$wgOut->addHTML( "\n<input type='hidden' value=\"$token\" name=\"wpEditToken\" />\n" );

If you take a look at this hidden value line in the resulting
page text, you will note it looks something like this:

<input type='hidden' value="+\" name="wpEditToken" />

Note the extra back-slash in the value="+\" string.  Something is fishy
there, it shouldn't be there.

This behavior is in the MediaWiki 1.14alpha version I see today
at http://www.mediawiki.org/wiki/Special:Version

For example:
$ wget 'http://www.mediawiki.org/w/index.php?title=Test_edit&action=edit' \
         -O editTest.html
$ grep wpEditToken editTest.html
<input type='hidden' value="+\" name="wpEditToken" />

This little bug caused problems in out down-stream processing which was trying
to parse this FORM INPUT variable.

--Hiram







More information about the MediaWiki-l mailing list