Page MenuHomePhabricator

Special:Import invalid token message on & in input
Closed, InvalidPublic


Author: bugzilla.wikimedia

when importing data,
the import feature fails if, within the <text></text> area
(thus typically in the "user" part of the file)
there is & character.
(say : Alice & Bob )

Version: 1.5.x
Severity: normal



Revisions and Commits

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:46 PM
bzimport set Reference to bz3110.
bzimport added a subscriber: Unknown Object (MLST).

bugzilla.wikimedia wrote:

I forgot to say that eveything works properly if you use
&amp; &lt; &gt; characters.
And that these characters are properly generated when exporting.

However, the problem arises when you prepare your own XML file
from data coming from another source.

So this bug report may be consider as a small bug or as a documentation problem.

(I believe it would be interesting to facilitate the importation/exchange
of data with non mediawiki applics or even with non wiki applic...)

bugzilla.wikimedia wrote:

there is a similar problem with the slash " / "
but more serious.

the $this->mTitle instance variable remains null
and there is thus a PHP error when trying to get the namespace on
this unexistant object.

the problem appears when the " / " is in the title of the page.

on the other and, replacing " / " by &#47; in the title is OK,
but replacing " / " by &#47; in the text is not really loved by the
program : invalid token (due to the & of &#47;).

Note that, in this case, seems that the export functionnality *will*
generate the " / ", thus producing a PHP error when reimporting mediawiki data.

Input must, in fact, be valid, or you will of course get errors -- so closing this bug.

Please provide a sample input file that you believe should be valid but which fails, if you think there's a problem.

Diffusion changed the task status from Invalid to Resolved by committing Unknown Object (Diffusion Commit).Mar 4 2015, 8:16 AM
Diffusion added a commit: Unknown Object (Diffusion Commit).
Aklapper changed the task status from Resolved to Invalid.Mar 4 2015, 5:47 PM
Aklapper claimed this task.