wfDebug( __METHOD__ . ': supposed to render ' . $this->getName() .
' (' . $this->getMimeType() . "), but can't!\n" );
- return $this->getURL(); #hm... return NULL?
+ return $this->getURL(); # hm... return NULL?
}
} else {
return $this->getURL();
$type = $this->getMediaType();
$mime = $this->getMimeType();
- #wfDebug( "LocalFile::isSafeFile: type= $type, mime= $mime\n" );
+ # wfDebug( "LocalFile::isSafeFile: type= $type, mime= $mime\n" );
if ( !$type || $type === MEDIATYPE_UNKNOWN ) {
- return false; #unknown type, not trusted
+ return false; # unknown type, not trusted
}
if ( in_array( $type, $wgTrustedMediaFormats ) ) {
return true;
}
if ( $mime === "unknown/unknown" ) {
- return false; #unknown type, not trusted
+ return false; # unknown type, not trusted
}
if ( in_array( $mime, $wgTrustedMediaFormats ) ) {
return true;
* @return bool
*/
function isTrustedFile() {
- #this could be implemented to check a flag in the database,
- #look for signatures, etc
+ # this could be implemented to check a flag in the database,
+ # look for signatures, etc
return false;
}
$extension = $this->getExtension();
list( $thumbExt, ) = $this->getHandler()->getThumbType(
$extension, $this->getMimeType(), $params );
- $thumbName = $this->getHandler()->makeParamString( $params ) . '-' . $name;
- if ( $thumbExt != $extension ) {
- $thumbName .= ".$thumbExt";
+ $thumbName = $this->getHandler()->makeParamString( $params );
+
+ if ( $this->repo->supportsSha1URLs() ) {
+ $thumbName .= '-' . $this->getSha1() . '.' . $thumbExt;
+ } else {
+ $thumbName .= '-' . $name;
+
+ if ( $thumbExt != $extension ) {
+ $thumbName .= ".$thumbExt";
+ }
}
return $thumbName;