* (bug 2780) Fix thumbnail generation with GD for new image schema
[lhc/web/wiklou.git] / includes / ImagePage.php
index f950dca..d8c0b8c 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,13 @@ class ImagePage extends Article {
                                $this->viewUpdates();
                        }
 
+                       if ($this->mExtraDescription) {
+                               $fol = wfMsg('shareddescriptionfollows');
+                               if ($fol != '-')
+                                       $wgOut->addWikiText(wfMsg('shareddescriptionfollows'));
+                               $wgOut->addHTML($this->mExtraDescription);
+                       }
+
                        $this->closeShowImage();
                        $this->imageHistory();
                        $this->imageLinks();
@@ -251,10 +259,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;
                }
        }