- $res = $this->select(__METHOD__);
- while($row = $db->fetchObject($res)) {
- $a = array(
- 'type' => $row->pr_type,
- 'level' => $row->pr_level,
- 'expiry' => Block::decodeExpiry($row->pr_expiry, TS_ISO_8601)
- );
- if($row->pr_cascade)
- $a['cascade'] = '';
- $this->protections[$row->page_namespace][$row->page_title][] = $a;
-
- # Also check old restrictions
- if($pageRestrictions[$row->pr_page]) {
- foreach(explode(':', trim($this->pageRestrictions[$row->pr_page])) as $restrict) {
- $temp = explode('=', trim($restrict));
- if(count($temp) == 1) {
- // old old format should be treated as edit/move restriction
- $restriction = trim( $temp[0] );
-
- if($restriction == '')
- continue;
- $this->protections[$row->page_namespace][$row->page_title][] = array(
- 'type' => 'edit',
- 'level' => $restriction,
- 'expiry' => 'infinity',
- );
- $this->protections[$row->page_namespace][$row->page_title][] = array(
- 'type' => 'move',
- 'level' => $restriction,
- 'expiry' => 'infinity',
- );
- } else {
- $restriction = trim($temp[1]);
- if($restriction == '')
- continue;
- $this->protections[$row->page_namespace][$row->page_title][] = array(
- 'type' => $temp[0],
- 'level' => $restriction,
- 'expiry' => 'infinity',
- );
+ $res = $this->select(__METHOD__);
+ while($row = $db->fetchObject($res)) {
+ $a = array(
+ 'type' => $row->pr_type,
+ 'level' => $row->pr_level,
+ 'expiry' => Block::decodeExpiry($row->pr_expiry, TS_ISO_8601)
+ );
+ if($row->pr_cascade)
+ $a['cascade'] = '';
+ $this->protections[$row->page_namespace][$row->page_title][] = $a;
+
+ # Also check old restrictions
+ if($pageRestrictions[$row->pr_page]) {
+ $restrictions = explode(':', trim($this->pageRestrictions[$row->pr_page]));
+ foreach($restrictions as $restrict) {
+ $temp = explode('=', trim($restrict));
+ if(count($temp) == 1) {
+ // old old format should be treated as edit/move restriction
+ $restriction = trim($temp[0]);
+
+ if($restriction == '')
+ continue;
+ $this->protections[$row->page_namespace][$row->page_title][] = array(
+ 'type' => 'edit',
+ 'level' => $restriction,
+ 'expiry' => 'infinity',
+ );
+ $this->protections[$row->page_namespace][$row->page_title][] = array(
+ 'type' => 'move',
+ 'level' => $restriction,
+ 'expiry' => 'infinity',
+ );
+ } else {
+ $restriction = trim($temp[1]);
+ if($restriction == '')
+ continue;
+ $this->protections[$row->page_namespace][$row->page_title][] = array(
+ 'type' => $temp[0],
+ 'level' => $restriction,
+ 'expiry' => 'infinity',
+ );
+ }