Index: trunk/phase3/includes/Article.php |
— | — | @@ -1857,14 +1857,23 @@ |
1858 | 1858 | $changed = false; |
1859 | 1859 | foreach( $wgRestrictionTypes as $action ) { |
1860 | 1860 | if( isset( $expiry[$action] ) ) { |
1861 | | - $current[$action] = implode( '', $this->mTitle->getRestrictions( $action ) ); |
1862 | | - $changed = ($changed || ($this->mTitle->mRestrictionsExpiry[$action] != $expiry[$action]) ); |
| 1861 | + # Get current restrictions on $action |
| 1862 | + $aLimits = $this->mTitle->getRestrictions( $action ); |
| 1863 | + $current[$action] = implode( '', $aLimits ); |
| 1864 | + # Are any actual restrictions being dealt with here? |
| 1865 | + $aRChanged = count($aLimits) || !empty($limit[$action]); |
| 1866 | + # If something changed, we need to log it. Checking $aRChanged |
| 1867 | + # assures that "unprotecting" a page that is not protected does |
| 1868 | + # not log just because the expiry was "changed". |
| 1869 | + if( $aRChanged && $this->mTitle->mRestrictionsExpiry[$action] != $expiry[$action] ) { |
| 1870 | + $changed = true; |
| 1871 | + } |
1863 | 1872 | } |
1864 | 1873 | } |
1865 | 1874 | |
1866 | 1875 | $current = Article::flattenRestrictions( $current ); |
1867 | 1876 | |
1868 | | - $changed = ($changed || ( $current != $updated ) ); |
| 1877 | + $changed = ($changed || $current != $updated ); |
1869 | 1878 | $changed = $changed || ($updated && $this->mTitle->areRestrictionsCascading() != $cascade); |
1870 | 1879 | $protect = ( $updated != '' ); |
1871 | 1880 | |