Merge "Update set of files cleaned up after parserTests"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index c9e435e..c19a51d 100644 (file)
@@ -97,10 +97,10 @@ abstract class File {
        /** @var Title|string|bool */
        protected $title;
 
-       /** @var string Text of last error  */
+       /** @var string Text of last error */
        protected $lastError;
 
-       /** @var string Main part of the title, with underscores (Title::getDBkey)  */
+       /** @var string Main part of the title, with underscores (Title::getDBkey) */
        protected $redirected;
 
        /** @var Title */
@@ -586,6 +586,7 @@ abstract class File {
                if ( !$handler ) {
                        return false;
                }
+
                return $handler->getCommonMetaArray( $this );
        }
 
@@ -1065,16 +1066,17 @@ abstract class File {
 
        /**
         * @param string $thumbName Thumbnail name
+        * @param string $dispositionType Type of disposition (either "attachment" or "inline")
         * @return string Content-Disposition header value
         */
-       function getThumbDisposition( $thumbName ) {
+       function getThumbDisposition( $thumbName, $dispositionType = 'inline' ) {
                $fileName = $this->name; // file name to suggest
                $thumbExt = FileBackend::extensionFromPath( $thumbName );
                if ( $thumbExt != '' && $thumbExt !== $this->getExtension() ) {
                        $fileName .= ".$thumbExt";
                }
 
-               return FileBackend::makeContentDisposition( 'inline', $fileName );
+               return FileBackend::makeContentDisposition( $dispositionType, $fileName );
        }
 
        /**
@@ -1328,7 +1330,7 @@ abstract class File {
                $this->assertRepoDefined();
 
                return $this->repo->getZonePath( 'thumb' ) . '/' .
-                       $this->getArchiveThumbRel( $archiveName, $suffix );
+               $this->getArchiveThumbRel( $archiveName, $suffix );
        }
 
        /**