Index: trunk/phase3/includes/Title.php |
— | — | @@ -1435,14 +1435,12 @@ |
1436 | 1436 | |
1437 | 1437 | if( $action == 'create' ) { |
1438 | 1438 | $title_protection = $this->getTitleProtection(); |
1439 | | - if( is_array($title_protection) ) { |
1440 | | - extract($title_protection); // is this extract() really needed? |
1441 | | - |
1442 | | - if( $pt_create_perm == 'sysop' ) { |
1443 | | - $pt_create_perm = 'protect'; // B/C |
| 1439 | + if( $title_protection ) { |
| 1440 | + if( $title_protection['pt_create_perm'] == 'sysop' ) { |
| 1441 | + $title_protection['pt_create_perm'] = 'protect'; // B/C |
1444 | 1442 | } |
1445 | | - if( $pt_create_perm == '' || !$user->isAllowed($pt_create_perm) ) { |
1446 | | - $errors[] = array( 'titleprotected', User::whoIs($pt_user), $pt_reason ); |
| 1443 | + if( $title_protection['pt_create_perm'] == '' || !$user->isAllowed($title_proection['pt_create_perm']) ) { |
| 1444 | + $errors[] = array( 'titleprotected', User::whoIs($title_protection['pt_user']), $title_protection['pt_reason'] ); |
1447 | 1445 | } |
1448 | 1446 | } |
1449 | 1447 | } elseif( $action == 'move' ) { |
— | — | @@ -2081,16 +2079,14 @@ |
2082 | 2080 | } else { |
2083 | 2081 | $title_protection = $this->getTitleProtection(); |
2084 | 2082 | |
2085 | | - if (is_array($title_protection)) { |
2086 | | - extract($title_protection); |
2087 | | - |
| 2083 | + if ($title_protection) { |
2088 | 2084 | $now = wfTimestampNow(); |
2089 | | - $expiry = Block::decodeExpiry($pt_expiry); |
| 2085 | + $expiry = Block::decodeExpiry($title_protection['pt_expiry']); |
2090 | 2086 | |
2091 | 2087 | if (!$expiry || $expiry > $now) { |
2092 | 2088 | // Apply the restrictions |
2093 | 2089 | $this->mRestrictionsExpiry['create'] = $expiry; |
2094 | | - $this->mRestrictions['create'] = explode(',', trim($pt_create_perm) ); |
| 2090 | + $this->mRestrictions['create'] = explode(',', trim($title_protection['pt_create_perm']) ); |
2095 | 2091 | } else { // Get rid of the old restrictions |
2096 | 2092 | Title::purgeExpiredRestrictions(); |
2097 | 2093 | } |