]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - includes/filerepo/UnregisteredLocalFile.php
MediaWiki 1.17.0
[autoinstallsdev/mediawiki.git] / includes / filerepo / UnregisteredLocalFile.php
index 419c61f6cd45e23931874461ab894395e60f4c95..990a218c2277dce681c0784c9f50e12eca635c0d 100644 (file)
@@ -1,14 +1,22 @@
 <?php
+/**
+ * File without associated database record
+ *
+ * @file
+ * @ingroup FileRepo
+ */
 
 /**
- * A file object referring to either a standalone local file, or a file in a 
+ * A file object referring to either a standalone local file, or a file in a
  * local repository with no database, for example an FSRepo repository.
  *
  * Read-only.
  *
- * TODO: Currently it doesn't really work in the repository role, there are 
- * lots of functions missing. It is used by the WebStore extension in the 
+ * TODO: Currently it doesn't really work in the repository role, there are
+ * lots of functions missing. It is used by the WebStore extension in the
  * standalone role.
+ *
+ * @ingroup FileRepo
  */
 class UnregisteredLocalFile extends File {
        var $title, $path, $mime, $handler, $dims;
@@ -30,7 +38,7 @@ class UnregisteredLocalFile extends File {
                        $this->name = $repo->getNameFromTitle( $title );
                } else {
                        $this->name = basename( $path );
-                       $this->title = Title::makeTitleSafe( NS_IMAGE, $this->name );
+                       $this->title = Title::makeTitleSafe( NS_FILE, $this->name );
                }
                $this->repo = $repo;
                if ( $path ) {
@@ -92,7 +100,7 @@ class UnregisteredLocalFile extends File {
 
        function getURL() {
                if ( $this->repo ) {
-                       return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . urlencode( $this->name );
+                       return $this->repo->getZoneUrl( 'public' ) . '/' . $this->repo->getHashPath( $this->name ) . rawurlencode( $this->name );
                } else {
                        return false;
                }
@@ -106,4 +114,3 @@ class UnregisteredLocalFile extends File {
                }
        }
 }
-