class UnregisteredLocalFile extends File {
var $title, $path, $mime, $handler, $dims;
- function newFromPath( $path, $mime ) {
+ static function newFromPath( $path, $mime ) {
return new UnregisteredLocalFile( false, false, $path, $mime );
}
- function newFromTitle( $title, $repo ) {
+ static function newFromTitle( $title, $repo ) {
return new UnregisteredLocalFile( $title, $repo, false, false );
}
}
if ( $title ) {
$this->title = $title;
- $this->name = $title->getDBkey();
+ $this->name = $repo->getNameFromTitle( $title );
} else {
$this->name = basename( $path );
$this->title = Title::makeTitleSafe( NS_IMAGE, $this->name );
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 ) . urlencode( $this->name );
} else {
return false;
}