From 825c01b60101bc98f23390bbb710cae9aca3dc37 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 5 Dec 2005 07:08:04 +0000 Subject: [PATCH] * (bug 1850) Additional fixes so existing local and remote images get a blue link even if there's no local description page --- RELEASE-NOTES | 2 ++ includes/Parser.php | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 671e7c7742..b4551e4e6b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -295,6 +295,8 @@ fully support the editing toolbar, but was found to be too confusing. * Add createpage and createtalk permission keys, allowing a quick switch to disable page creation for anonymous users. * (bug 4167) Fix regression caused by patch for bug 153 +* (bug 1850) Additional fixes so existing local and remote images + get a blue link even if there's no local description page === Caveats === diff --git a/includes/Parser.php b/includes/Parser.php index a02d205d62..f52dc9be0b 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1464,6 +1464,15 @@ class Parser } elseif( $ns == NS_SPECIAL ) { $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail ); continue; + } elseif( $ns == NS_IMAGE ) { + $img = Image::newFromTitle( $nt ); + if( $img->exists() ) { + // Force a blue link if the file exists; may be a remote + // upload on the shared repository, and we want to see its + // auto-generated page. + $s .= $prefix . $sk->makeKnownLinkObj( $nt, $text, '', $trail ); + continue; + } } $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix ); } -- 2.20.1