From: Roan Kattouw Date: Tue, 9 Sep 2008 20:42:19 +0000 (+0000) Subject: (bug 15535) prop=info&inprop=protection doesn't list pre-1.10 protections if the... X-Git-Tag: 1.31.0-rc.0~45390 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=3256fbb3bf0d84ca21e2c5c750e5565e486b59fe;p=lhc%2Fweb%2Fwiklou.git (bug 15535) prop=info&inprop=protection doesn't list pre-1.10 protections if the page is also protected otherwise (1.10+ style or cascading) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4d3fd6e160..fb6bee0fed 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -226,6 +226,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 15486) action=block ignores autoblock parameter * (bug 15492) added rcprop=loginfo to list=recentchanges * (bug 15527) action=rollback can now revert anonymous editors +* (bug 15535) prop=info&inprop=protection doesn't list pre-1.10 protections + if the page is also protected otherwise (1.10+ style or cascading) === Languages updated in 1.14 === diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 884473eac1..a8cc0c6fdb 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -412,40 +412,38 @@ class ApiQueryInfo extends ApiQueryBase { } if($fld_protection) { + $pageInfo['protection'] = array(); if (isset($protections[$pageid])) { $pageInfo['protection'] = $protections[$pageid]; $result->setIndexedTagName($pageInfo['protection'], 'pr'); - } else { - # Also check old restrictions - if( $pageRestrictions[$pageid] ) { - foreach( explode( ':', trim( $pageRestrictions[$pageid] ) ) as $restrict ) { - $temp = explode( '=', trim( $restrict ) ); - if(count($temp) == 1) { - // old old format should be treated as edit/move restriction - $restriction = trim( $temp[0] ); - $pageInfo['protection'][] = array( - 'type' => 'edit', - 'level' => $restriction, - 'expiry' => 'infinity', - ); - $pageInfo['protection'][] = array( - 'type' => 'move', - 'level' => $restriction, - 'expiry' => 'infinity', - ); - } else { - $restriction = trim( $temp[1] ); - $pageInfo['protection'][] = array( - 'type' => $temp[0], - 'level' => $restriction, - 'expiry' => 'infinity', - ); - } + } + # Also check old restrictions + if( $pageRestrictions[$pageid] ) { + foreach( explode( ':', trim( $pageRestrictions[$pageid] ) ) as $restrict ) { + $temp = explode( '=', trim( $restrict ) ); + if(count($temp) == 1) { + // old old format should be treated as edit/move restriction + $restriction = trim( $temp[0] ); + $pageInfo['protection'][] = array( + 'type' => 'edit', + 'level' => $restriction, + 'expiry' => 'infinity', + ); + $pageInfo['protection'][] = array( + 'type' => 'move', + 'level' => $restriction, + 'expiry' => 'infinity', + ); + } else { + $restriction = trim( $temp[1] ); + $pageInfo['protection'][] = array( + 'type' => $temp[0], + 'level' => $restriction, + 'expiry' => 'infinity', + ); } - $result->setIndexedTagName($pageInfo['protection'], 'pr'); - } else { - $pageInfo['protection'] = array(); } + $result->setIndexedTagName($pageInfo['protection'], 'pr'); } } if($fld_talkid && isset($talkids[$title->getNamespace()][$title->getDbKey()]))