Index: trunk/phase3/includes/Article.php |
— | — | @@ -1831,25 +1831,25 @@ |
1832 | 1832 | // Delete if changing from redirect to non-redirect |
1833 | 1833 | $isRedirect = !is_null( $redirectTitle ); |
1834 | 1834 | |
1835 | | - if ( $isRedirect || is_null( $lastRevIsRedirect ) || $lastRevIsRedirect !== $isRedirect ) { |
1836 | | - wfProfileIn( __METHOD__ ); |
1837 | | - if ( $isRedirect ) { |
1838 | | - $this->insertRedirectEntry( $redirectTitle ); |
1839 | | - } else { |
1840 | | - // This is not a redirect, remove row from redirect table |
1841 | | - $where = array( 'rd_from' => $this->getId() ); |
1842 | | - $dbw->delete( 'redirect', $where, __METHOD__ ); |
1843 | | - } |
| 1835 | + if ( !$isRedirect && !is_null( $lastRevIsRedirect ) && $lastRevIsRedirect === $isRedirect ) { |
| 1836 | + return true; |
| 1837 | + } |
| 1838 | + |
| 1839 | + wfProfileIn( __METHOD__ ); |
| 1840 | + if ( $isRedirect ) { |
| 1841 | + $this->insertRedirectEntry( $redirectTitle ); |
| 1842 | + } else { |
| 1843 | + // This is not a redirect, remove row from redirect table |
| 1844 | + $where = array( 'rd_from' => $this->getId() ); |
| 1845 | + $dbw->delete( 'redirect', $where, __METHOD__ ); |
| 1846 | + } |
1844 | 1847 | |
1845 | | - if ( $this->getTitle()->getNamespace() == NS_FILE ) { |
1846 | | - RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $this->getTitle() ); |
1847 | | - } |
1848 | | - wfProfileOut( __METHOD__ ); |
1849 | | - |
1850 | | - return ( $dbw->affectedRows() != 0 ); |
| 1848 | + if ( $this->getTitle()->getNamespace() == NS_FILE ) { |
| 1849 | + RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $this->getTitle() ); |
1851 | 1850 | } |
| 1851 | + wfProfileOut( __METHOD__ ); |
1852 | 1852 | |
1853 | | - return true; |
| 1853 | + return ( $dbw->affectedRows() != 0 ); |
1854 | 1854 | } |
1855 | 1855 | |
1856 | 1856 | /** |