Revert r29361 -- breaks upload, calls nonexistent functions
[lhc/web/wiklou.git] / includes / filerepo / File.php
index 84b64fb..7e222a0 100644 (file)
@@ -149,6 +149,21 @@ abstract class File {
                }
                return $this->url; 
        }
+       
+       /**
+        * Return a fully-qualified URL to the file.
+        * Upload URL paths _may or may not_ be fully qualified, so
+        * we check. Local paths are assumed to belong on $wgServer.
+        * @return string
+        */
+       public function getFullUrl() {
+               $url = $this->getUrl();
+               if( substr( $url, 0, 1 ) == '/' ) {
+                       global $wgServer;
+                       return $wgServer . $url;
+               }
+               return $url;
+       }
 
        function getViewURL() {
                if( $this->mustRender()) {
@@ -559,7 +574,7 @@ abstract class File {
                        $path = '/common/images/icons/' . $icon;
                        $filepath = $wgStyleDirectory . $path;
                        if( file_exists( $filepath ) ) {
-                               return new ThumbnailImage( $wgStylePath . $path, 120, 120 );
+                               return new ThumbnailImage( $this, $wgStylePath . $path, 120, 120 );
                        }
                }
                return null;
@@ -1014,7 +1029,7 @@ abstract class File {
        }
 
        /**
-        * Get an associative array containing information about a file in the local filesystem\
+        * Get an associative array containing information about a file in the local filesystem.
         *
         * @param string $path Absolute local filesystem path
         * @param mixed $ext The file extension, or true to extract it from the filename.