https://bugzilla.wikimedia.org/show_bug.cgi?id=36358
Web browser: ---
Bug #: 36358
Summary: ApiQueryBase::titlePartToKey doesn't work correctly
with the # character
Product: MediaWiki
Version: 1.20-git
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: API
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
Classification: Unclassified
Mobile Platform: ---
The function titlePartToKey in the class ApiQueryBase doesn't work correctly in
the presence of the # character in the $titlePart paramter: the last character
from the correct keyPart is removed. So, for example "WikiProject#" is
converted to "WikiProjec".
This is because of the way the function tries to keep trailing spaces by
appending "x" to the title and then removing it from the resulting key. The
problem happens because titleToKey correctly removes everything after the # and
substr then incorrectly removes some other character.
This happens for example in the query
http://en.wikipedia.org/w/api.php?format=xml&action=query&list=allpages&apnamespace=4&apprefix=WikiProject%23
which lists all pages in the namespace 4 whose name starts with WikiProjec
(without t).
(Note: The # character has to be URL-encoded as %23 in the URL, otherwise
browsers will treat it as an anchor.)
--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l