Merge "Return 400 on invalid CSP reports"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / ThumbnailRenderJob.php
index f558c48..cf3155d 100644 (file)
@@ -59,14 +59,16 @@ class ThumbnailRenderJob extends Job {
                                if ( $status === 200 || $status === 301 || $status === 302 || $status === 400 ) {
                                        return true;
                                } elseif ( $status ) {
-                                       $this->setLastError( __METHOD__ . ': incorrect HTTP status ' . $status . ' when hitting ' . $thumbUrl );
+                                       $this->setLastError( __METHOD__ . ': incorrect HTTP status ' .
+                                               $status . ' when hitting ' . $thumbUrl );
                                        return false;
                                } else {
                                        $this->setLastError( __METHOD__ . ': HTTP request failure' );
                                        return false;
                                }
                        } else {
-                               $this->setLastError( __METHOD__ . ': unknown thumbnail render method ' . $wgUploadThumbnailRenderMethod );
+                               $this->setLastError( __METHOD__ . ': unknown thumbnail render method ' .
+                                       $wgUploadThumbnailRenderMethod );
                                return false;
                        }
                } else {
@@ -75,7 +77,7 @@ class ThumbnailRenderJob extends Job {
                }
        }
 
-       protected function hitThumbUrl( $file, $transformParams, &$thumbUrl ) {
+       protected function hitThumbUrl( LocalFile $file, $transformParams, &$thumbUrl ) {
                global $wgUploadThumbnailRenderHttpCustomHost, $wgUploadThumbnailRenderHttpCustomDomain;
 
                $thumbName = $file->thumbName( $transformParams );
@@ -94,7 +96,7 @@ class ThumbnailRenderJob extends Job {
                wfDebug( __METHOD__ . ": hitting url {$thumbUrl}\n" );
 
                $request = MWHttpRequest::factory( $thumbUrl,
-                       array( 'method' => 'HEAD', 'followRedirects' => true ),
+                       [ 'method' => 'HEAD', 'followRedirects' => true ],
                        __METHOD__
                );