* (bug 1850) Additional fixes so existing local and remote images
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Dec 2005 07:08:04 +0000 (07:08 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Dec 2005 07:08:04 +0000 (07:08 +0000)
  get a blue link even if there's no local description page

RELEASE-NOTES
includes/Parser.php

index 671e7c7..b4551e4 100644 (file)
@@ -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 ===
index a02d205..f52dc9b 100644 (file)
@@ -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 );
                }