Merge "Readd word-separator between edithelp link and newwindow hint"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 15 Sep 2014 21:00:40 +0000 (21:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 15 Sep 2014 21:00:40 +0000 (21:00 +0000)
includes/specialpage/WantedQueryPage.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWantedfiles.php

index 678c803..be2f1e8 100644 (file)
@@ -78,15 +78,9 @@ abstract class WantedQueryPage extends QueryPage {
                $title = Title::makeTitleSafe( $result->namespace, $result->title );
                if ( $title instanceof Title ) {
                        if ( $this->isCached() || $this->forceExistenceCheck() ) {
-                               $pageLink = $title->isKnown()
+                               $pageLink = $this->existenceCheck( $title )
                                        ? '<del>' . Linker::link( $title ) . '</del>'
-                                       : Linker::link(
-                                               $title,
-                                               null,
-                                               array(),
-                                               array(),
-                                               array( 'broken' )
-                                       );
+                                       : Linker::link( $title );
                        } else {
                                $pageLink = Linker::link(
                                        $title,
@@ -102,6 +96,25 @@ abstract class WantedQueryPage extends QueryPage {
                }
        }
 
+       /**
+        * Does the Title currently exists
+        *
+        * This method allows a subclass to override this check
+        * (For example, wantedfiles, would want to check if the file exists
+        * not just that a page in the file namespace exists).
+        *
+        * This will only control if the link is crossed out. Whether or not the link
+        * is blue vs red is controlled by if the title exists.
+        *
+        * @note This will only be run if the page is cached (ie $wgMiserMode = true)
+        *   unless forceExistenceCheck() is true.
+        * @since 1.24
+        * @return boolean
+        */
+       protected function existenceCheck( Title $title ) {
+               return $title->isKnown();
+       }
+
        /**
         * Make a "what links here" link for a given title
         *
index 97c7704..cb3fc11 100644 (file)
@@ -204,7 +204,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @return string
         */
-       static function softwareInformation() {
+       public static function softwareInformation() {
                $dbr = wfGetDB( DB_SLAVE );
 
                // Put the software in an array of form 'name' => 'version'. All messages should
@@ -428,7 +428,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @return string Wikitext
         */
-       function getExtensionCredits() {
+       public function getExtensionCredits() {
                global $wgExtensionCredits;
 
                if (
@@ -482,7 +482,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @return string Wikitext
         */
-       function getSkinCredits() {
+       public function getSkinCredits() {
                global $wgExtensionCredits;
                if ( !isset( $wgExtensionCredits['skin'] ) || count( $wgExtensionCredits['skin'] ) === 0 ) {
                        return '';
@@ -593,7 +593,7 @@ class SpecialVersion extends SpecialPage {
         * @param array $b
         * @return int
         */
-       function compare( $a, $b ) {
+       public function compare( $a, $b ) {
                if ( $a['name'] === $b['name'] ) {
                        return 0;
                } else {
@@ -620,7 +620,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @return string Raw HTML
         */
-       function getCreditsForExtension( array $extension ) {
+       public function getCreditsForExtension( array $extension ) {
                $out = $this->getOutput();
 
                // We must obtain the information for all the bits and pieces!
@@ -905,7 +905,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @return string HTML fragment
         */
-       function listAuthors( $authors, $extName, $extDir ) {
+       public function listAuthors( $authors, $extName, $extDir ) {
                $hasOthers = false;
 
                $list = array();
@@ -1008,7 +1008,7 @@ class SpecialVersion extends SpecialPage {
         *
         * @return string
         */
-       function listToText( $list, $sort = true ) {
+       public function listToText( $list, $sort = true ) {
                if ( !count( $list ) ) {
                        return '';
                }
index 8269b01..937a503 100644 (file)
@@ -93,6 +93,18 @@ class WantedFilesPage extends WantedQueryPage {
                return true;
        }
 
+       /**
+        * Does the file exist?
+        *
+        * Use wfFindFile so we still think file namespace pages without
+        * files are missing, but valid file redirects and foreign files are ok.
+        *
+        * @return boolean
+        */
+       protected function existenceCheck( Title $title ) {
+               return (bool) wfFindFile( $title );
+       }
+
        function getQueryInfo() {
                return array(
                        'tables' => array(