$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,
}
}
+ /**
+ * 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
*
*
* @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
*
* @return string Wikitext
*/
- function getExtensionCredits() {
+ public function getExtensionCredits() {
global $wgExtensionCredits;
if (
*
* @return string Wikitext
*/
- function getSkinCredits() {
+ public function getSkinCredits() {
global $wgExtensionCredits;
if ( !isset( $wgExtensionCredits['skin'] ) || count( $wgExtensionCredits['skin'] ) === 0 ) {
return '';
* @param array $b
* @return int
*/
- function compare( $a, $b ) {
+ public function compare( $a, $b ) {
if ( $a['name'] === $b['name'] ) {
return 0;
} else {
*
* @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!
*
* @return string HTML fragment
*/
- function listAuthors( $authors, $extName, $extDir ) {
+ public function listAuthors( $authors, $extName, $extDir ) {
$hasOthers = false;
$list = array();
*
* @return string
*/
- function listToText( $list, $sort = true ) {
+ public function listToText( $list, $sort = true ) {
if ( !count( $list ) ) {
return '';
}
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(