Index: trunk/phase3/includes/Title.php |
— | — | @@ -1602,6 +1602,10 @@ |
1603 | 1603 | return $this->mTitleProtection; |
1604 | 1604 | } |
1605 | 1605 | |
| 1606 | + private function invalidateTitleProtectionCache() { |
| 1607 | + unset( $this->mTitleProtection ); |
| 1608 | + } |
| 1609 | + |
1606 | 1610 | /** |
1607 | 1611 | * Update the title protection status |
1608 | 1612 | * |
— | — | @@ -1650,6 +1654,8 @@ |
1651 | 1655 | $dbw->delete( 'protected_titles', array( 'pt_namespace' => $namespace, |
1652 | 1656 | 'pt_title' => $title ), __METHOD__ ); |
1653 | 1657 | } |
| 1658 | + $this->invalidateTitleProtectionCache(); |
| 1659 | + |
1654 | 1660 | # Update the protection log |
1655 | 1661 | if ( $dbw->affectedRows() ) { |
1656 | 1662 | $log = new LogPage( 'protect' ); |
— | — | @@ -1676,6 +1682,7 @@ |
1677 | 1683 | array( 'pt_namespace' => $this->getNamespace(), 'pt_title' => $this->getDBkey() ), |
1678 | 1684 | __METHOD__ |
1679 | 1685 | ); |
| 1686 | + $this->invalidateTitleProtectionCache(); |
1680 | 1687 | } |
1681 | 1688 | |
1682 | 1689 | /** |
— | — | @@ -2058,6 +2065,7 @@ |
2059 | 2066 | } |
2060 | 2067 | if ( $purgeExpired ) { |
2061 | 2068 | Title::purgeExpiredRestrictions(); |
| 2069 | + $this->invalidateTitleProtectionCache(); |
2062 | 2070 | } |
2063 | 2071 | |
2064 | 2072 | wfProfileOut( __METHOD__ ); |
— | — | @@ -2177,6 +2185,7 @@ |
2178 | 2186 | |
2179 | 2187 | if ( $purgeExpired ) { |
2180 | 2188 | Title::purgeExpiredRestrictions(); |
| 2189 | + $this->invalidateTitleProtectionCache(); |
2181 | 2190 | } |
2182 | 2191 | } |
2183 | 2192 | |
— | — | @@ -2211,6 +2220,7 @@ |
2212 | 2221 | $this->mRestrictions['create'] = explode( ',', trim( $title_protection['pt_create_perm'] ) ); |
2213 | 2222 | } else { // Get rid of the old restrictions |
2214 | 2223 | Title::purgeExpiredRestrictions(); |
| 2224 | + $this->invalidateTitleProtectionCache(); |
2215 | 2225 | } |
2216 | 2226 | } else { |
2217 | 2227 | $this->mRestrictionsExpiry['create'] = Block::decodeExpiry( '' ); |