* (bug 7890) Special:BrokenRedirects links deleted redirects to a non-existent page
authorRotem Liss <rotem@users.mediawiki.org>
Fri, 14 Sep 2007 04:21:36 +0000 (04:21 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Fri, 14 Sep 2007 04:21:36 +0000 (04:21 +0000)
** See explanation in the bug report.
* Adding some TODO notes: current implementation of Special:BrokenRedirects caching can be improved.

RELEASE-NOTES
includes/SpecialBrokenRedirects.php
includes/Title.php

index bf66d9c..295cf7a 100644 (file)
@@ -49,6 +49,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 4021) Fix for MySQL wildcard search
 * (bug 10699) Fix for MySQL phrase search
 * (bug 11321) Fix width of gallerybox when option "width=xxx" is used
+* (bug 7890) Special:BrokenRedirects links deleted redirects to a non-existent page
 
 === API changes in 1.12 ===
 
index 1fb4835..f688774 100644 (file)
@@ -51,7 +51,7 @@ class BrokenRedirectsPage extends PageQueryPage {
                if ( isset( $result->rd_title ) ) {
                        $toObj = Title::makeTitle( $result->rd_namespace, $result->rd_title );
                } else {
-                       $blinks = $fromObj->getBrokenLinksFrom();
+                       $blinks = $fromObj->getBrokenLinksFrom(); # TODO: check for redirect, not for links
                        if ( $blinks ) {
                                $toObj = $blinks[0];
                        } else {
index 7fc3e94..dc4a763 100644 (file)
@@ -2034,10 +2034,16 @@ class Title {
        /**
         * Get an array of Title objects referring to non-existent articles linked from this page
         *
+        * @todo check if needed (used only in SpecialBrokenRedirects.php, and should use redirect table in this case)
         * @param string $options may be FOR UPDATE
         * @return array the Title objects
         */
        public function getBrokenLinksFrom( $options = '' ) {
+               if ( $this->getArticleId() == 0 ) {
+                       # All links from article ID 0 are false positives
+                       return array();
+               }
+
                if ( $options ) {
                        $db = wfGetDB( DB_MASTER );
                } else {