diff options
author | Brad Jorsch <anomie.wikipedia@gmail.com> | 2012-05-21 13:07:37 -0400 |
---|---|---|
committer | Catrope <roan.kattouw@gmail.com> | 2012-07-17 16:08:39 -0700 |
commit | 2b3f4d821cd41fe3002e1cce15169d5b5700f7d8 (patch) | |
tree | 1cc0f47020c18ccf427a25215c1b8b6198738ad6 /includes/api/ApiQueryLangBacklinks.php | |
parent | 93867817063fd90be74dcdc5cc43e53f03015a55 (diff) | |
download | mediawikicore-2b3f4d821cd41fe3002e1cce15169d5b5700f7d8.tar.gz mediawikicore-2b3f4d821cd41fe3002e1cce15169d5b5700f7d8.zip |
Avoid mangling fields in API continuation parameters
API continuation parameters encode sufficient state for a subsequent
query to continue where the previous one left off; this may sometimes
include page titles, with or without the namespace. Given that these
page titles are already in the exact format required for the next
request's SQL query, it is not necessary to "normalize" them in any way.
And if normalization does more than just change spaces to underscores or
vice versa (e.g. it canonicalizes namespace aliases or capitalizes the
first letter of the title), it can be actively harmful: see bug 36987
and bug 29290.
Note this patch involves a breaking API change: the values for the
"continue" parameter of various modules have been changed, and some
modules will now return "continue" as the continuation parameter instead
of reusing "from".
Note this patch also corrects a minor logic bug in ApiQueryAllLinks,
changing ">" to ">=". The line is being changed anyway, so I didn't
bother doing a separate changeset.
Change-Id: I459232e919d20f89f6de9d20640fd48c8fd5781c
Diffstat (limited to 'includes/api/ApiQueryLangBacklinks.php')
-rw-r--r-- | includes/api/ApiQueryLangBacklinks.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/api/ApiQueryLangBacklinks.php b/includes/api/ApiQueryLangBacklinks.php index c7639ee5f305..6248c35003ca 100644 --- a/includes/api/ApiQueryLangBacklinks.php +++ b/includes/api/ApiQueryLangBacklinks.php @@ -64,7 +64,7 @@ class ApiQueryLangBacklinks extends ApiQueryGeneratorBase { $db = $this->getDB(); $op = $params['dir'] == 'descending' ? '<' : '>'; $prefix = $db->addQuotes( $cont[0] ); - $title = $db->addQuotes( $this->titleToKey( $cont[1] ) ); + $title = $db->addQuotes( $cont[1] ); $from = intval( $cont[2] ); $this->addWhere( "ll_lang $op $prefix OR " . |