Page MenuHomePhabricator

Title canonicalisation in AjaxFunctions.php
Closed, ResolvedPublic


Author: mediawiki

AjaxFunctions.php diff

The attached diff makes AjaxFunctions.php (revision 28538) more respectful of case and underscores in titles.

Motivation: I use a slightly modified mediawiki for a technical wiki where case and underscores are significant in page titles. This relies on titles being treated correctly. In particular, newFromText should not be used where the title has already been canonicalised into DB key form.

Changes include:

  • wfSajaxSearch:
    • Do not add underscores (Title::newFromText will do that).
    • Do not apply ucfirst to the search term unless wgCapitalLinks is true.
    • Use Title::makeTitle directly instead of Title::newFromText when using fields directly from the database (or the Special Pages lists).
  • wfAjaxWatch
    • Use Title::newFromDBkey instead of Title::newFromText in the wfAjaxWatch, where $pagename is already a DB key.

Version: 1.12.x
Severity: trivial




Event Timeline

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