Merge "mw.Upload.BookletLayout: Don't explode when the API call fails with 'exception'"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index ee11df9..8a3900e 100644 (file)
@@ -354,6 +354,16 @@ abstract class File implements IDBAccessObject {
                return $this->url;
        }
 
+       /*
+        * Get short description URL for a files based on the page ID
+        *
+        * @return string|null
+        * @since 1.27
+        */
+       public function getDescriptionShortUrl() {
+               return null;
+       }
+
        /**
         * Return a fully-qualified URL to the file.
         * Upload URL paths _may or may not_ be fully qualified, so
@@ -1176,8 +1186,13 @@ abstract class File implements IDBAccessObject {
                if ( !$this->repo
                        || !isset( $params['physicalWidth'] )
                        || !isset( $params['physicalHeight'] )
-                       || !( $bucket = $this->getThumbnailBucket( $params['physicalWidth'] ) )
-                       || $bucket == $params['physicalWidth'] ) {
+               ) {
+                       return false;
+               }
+
+               $bucket = $this->getThumbnailBucket( $params['physicalWidth'] );
+
+               if ( !$bucket || $bucket == $params['physicalWidth'] ) {
                        return false;
                }