Page MenuHomePhabricator

Can't move page with & in it's name
Closed, ResolvedPublic

Description

Author: aik.bold

Description:
Test case:

  1. Create page named "Why & got relaced" (without quotes). I type "amp;" twice, because & visually is transformed to "&" in HTML.
  2. In database page_title (dbkey) will be "Why_&_got_relaced"
  3. Go to that page & try to rename (move) it to title like this "test new title"
  4. This fails with message, that no form data submitted :( -------------

I've analyzed it a bit. This is what I've found:

  1. On the form we have hidden field "wpOldTitle" with value: "Why & got relaced", it's ok and input for new page name named "wpNewTitle".
  2. When submitting that values to php wpOldTitle becomes "Why & got relaced"
  3. method MovePageForm::doSubmit create Title objects from old title and new title

Problem begins, when Title::newFromText calls $filteredText = Sanitizer::decodeCharReferences( $text ); and replaces last "&" in old title name to "&" and old title becomes "Why_&_got_relaced". When method moveTo is called it fails, because can't load page by this name.


Version: 1.11.x
Severity: minor
OS: Windows XP
Platform: PC

Details

Reference
bz12436

Event Timeline

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

herd wrote:

AS a workaround, it seems to work if you change the URL of the default [move] URL from
Special:Movepage/Why_%26amp%3B_got_relaced
to a more escaped version:
Special:Movepage/Why_%26amp%3Bamp%3B_got_relaced

  • This bug has been marked as a duplicate of bug 3097 ***