show article text before commons text
authorRiver Tarnell <kateturner@users.mediawiki.org>
Mon, 4 Jul 2005 02:59:23 +0000 (02:59 +0000)
committerRiver Tarnell <kateturner@users.mediawiki.org>
Mon, 4 Jul 2005 02:59:23 +0000 (02:59 +0000)
includes/ImagePage.php

index f950dca..1105661 100644 (file)
@@ -18,6 +18,7 @@ require_once( 'Image.php' );
 class ImagePage extends Article {
 
        /* private */ var $img;  // Image object this page is shown for
+       var $mExtraDescription = false;
 
        function render() {
                global $wgOut;
@@ -58,6 +59,9 @@ class ImagePage extends Article {
                                $this->viewUpdates();
                        }
 
+                       if ($this->mExtraDescription)
+                               $wgOut->addWikiText($this->mExtraDescription);
+
                        $this->closeShowImage();
                        $this->imageHistory();
                        $this->imageLinks();
@@ -251,10 +255,10 @@ class ImagePage extends Article {
 
                if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) {
                        $ur = ini_set('allow_url_fopen', true);
-                       $text = @file_get_contents($url . '?action=render');
+                       $text = wfGetHTTP($url . '?action=render');
                        ini_set('allow_url_fopen', $ur);
                        if ($text)
-                               $wgOut->addHTML($text);
+                               $this->mExtraDescription = $text;
                }
        }