From 3c8ac109882b5382c6ba7c73f79c09f0c8e4f1c0 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Thu, 17 Apr 2008 12:58:20 +0000 Subject: [PATCH] (bug 13768) Handling case-insensitivity of pt_title in prop=info --- RELEASE-NOTES | 1 + includes/api/ApiQueryInfo.php | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9a9cbb49e5..6ddf2bd5e9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -238,6 +238,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13544) Added oldid parameter to action=parse to allow for parsing of old revisions * (bug 13718) Return the proper continue parameter for cmsort=timestamp * action=login now returns the correct waiting time in the details property +* (bug 13768) inprop=protection now honors case-insensitivity for protected titles === Languages updated in 1.13 === diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index adc8449597..ef07e94e15 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -116,7 +116,8 @@ class ApiQueryInfo extends ApiQueryBase { $res = $this->select(__METHOD__); $prottitles = array(); while($row = $db->fetchObject($res)) { - $prottitles[$row->pt_namespace][$row->pt_title] = array( + // Argh, pt_title is case-insensitive + $prottitles[$row->pt_namespace][strtolower($row->pt_title)] = array( 'type' => 'create', 'level' => $row->pt_create_perm, 'expiry' => Block::decodeExpiry($row->pt_expiry, TS_ISO_8601) @@ -249,8 +250,8 @@ class ApiQueryInfo extends ApiQueryBase { { // Apparently the XML formatting code doesn't like array(null) // This is painful to fix, so we'll just work around it - if(isset($prottitles[$title->getNamespace()][$title->getDBkey()])) - $res['query']['pages'][$pageid]['protection'][] = $prottitles[$title->getNamespace()][$title->getDBkey()]; + if(isset($prottitles[$title->getNamespace()][strtolower($title->getDBkey())])) + $res['query']['pages'][$pageid]['protection'][] = $prottitles[$title->getNamespace()][strtolower($title->getDBkey())]; else $res['query']['pages'][$pageid]['protection'] = array(); $result->setIndexedTagName($res['query']['pages'][$pageid]['protection'], 'pr'); -- 2.20.1