X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Ffilerepo%2Ffile%2FFile.php;h=df85f9c723b13f432c850ad9b99dbed02c9ad520;hb=ff05579d1c7fcf9d449bdd474b48338dd58b1c5d;hp=7563d642c686641906eb19077dfa557dd61513e7;hpb=ca28853e225fb8c3a2715c6f5bcc558d9e482590;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 7563d642c6..df85f9c723 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -138,10 +138,10 @@ abstract class File { /** @var Title */ protected $redirectTitle; - /** @var bool Wether the output of transform() for this file is likely to be valid. */ + /** @var bool Whether the output of transform() for this file is likely to be valid. */ protected $canRender; - /** @var bool Wether this media file is in a format that is unlikely to + /** @var bool Whether this media file is in a format that is unlikely to * contain viruses or malicious content */ protected $isSafeFile; @@ -490,7 +490,7 @@ abstract class File { sort( $sortedBuckets ); foreach ( $sortedBuckets as $bucket ) { - if ( $bucket > $imageWidth ) { + if ( $bucket >= $imageWidth ) { return false; } @@ -996,7 +996,6 @@ abstract class File { function transform( $params, $flags = 0 ) { global $wgThumbnailEpoch; - wfProfileIn( __METHOD__ ); do { if ( !$this->canRender() ) { $thumb = $this->iconThumb(); @@ -1069,8 +1068,6 @@ abstract class File { } } while ( false ); - wfProfileOut( __METHOD__ ); - return is_object( $thumb ) ? $thumb : false; } @@ -1100,9 +1097,7 @@ abstract class File { } // Actually render the thumbnail... - wfProfileIn( __METHOD__ . '-doTransform' ); $thumb = $handler->doTransform( $this, $tmpThumbPath, $thumbUrl, $transformParams ); - wfProfileOut( __METHOD__ . '-doTransform' ); $tmpFile->bind( $thumb ); // keep alive with $thumb if ( !$thumb ) { // bad params? @@ -1123,7 +1118,7 @@ abstract class File { $thumb = $this->transformErrorOutput( $thumbPath, $thumbUrl, $transformParams, $flags ); } // Give extensions a chance to do something with this thumbnail... - wfRunHooks( 'FileTransformed', array( $this, $thumb, $tmpThumbPath, $thumbPath ) ); + Hooks::run( 'FileTransformed', array( $this, $thumb, $tmpThumbPath, $thumbPath ) ); } // Purge. Useful in the event of Core -> Squid connection failure or squid @@ -1458,7 +1453,7 @@ abstract class File { /** * Get the path of the file relative to the public zone root. - * This function is overriden in OldLocalFile to be like getArchiveRel(). + * This function is overridden in OldLocalFile to be like getArchiveRel(). * * @return string */ @@ -1502,7 +1497,7 @@ abstract class File { /** * Get urlencoded path of the file relative to the public zone root. - * This function is overriden in OldLocalFile to be like getArchiveUrl(). + * This function is overridden in OldLocalFile to be like getArchiveUrl(). * * @return string */