Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / ThumbnailRenderJob.php
index 63575eb..85e3af9 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup JobQueue
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Job for asynchronous rendering of thumbnails.
  *
@@ -36,7 +38,8 @@ class ThumbnailRenderJob extends Job {
 
                $transformParams = $this->params['transformParams'];
 
-               $file = wfLocalFile( $this->title );
+               $file = MediaWikiServices::getInstance()->getRepoGroup()->getLocalRepo()
+                       ->newFile( $this->title );
                $file->load( File::READ_LATEST );
 
                if ( $file && $file->exists() ) {
@@ -93,7 +96,7 @@ class ThumbnailRenderJob extends Job {
                if ( $wgUploadThumbnailRenderHttpCustomDomain ) {
                        $parsedUrl = wfParseUrl( $thumbUrl );
 
-                       if ( !$parsedUrl || !isset( $parsedUrl['path'] ) || !strlen( $parsedUrl['path'] ) ) {
+                       if ( !isset( $parsedUrl['path'] ) || $parsedUrl['path'] === '' ) {
                                $this->setLastError( __METHOD__ . ": invalid thumb URL: $thumbUrl" );
                                return false;
                        }