Skip to content

Commit

Permalink
Merge pull request #614 from peterkeung/default-content-disposition
Browse files Browse the repository at this point in the history
Fix for EZP-20741: Allow default content disposition to be overridden
  • Loading branch information
andrerom committed Sep 24, 2013
2 parents 23a2ad2 + f0fc287 commit bed5589
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function handleFileDownload( $contentObject, $contentObjectAttribute, $type,
* Checks if a file should be downloaded to disk or displayed inline in
* the browser.
*
* This method returns "attachment" if no setting for the mime type is found.
* Behavior by MIME type and default behavior are configured in file.ini
*
* @param string $mimetype
* @return string "attachment" or "inline"
Expand All @@ -98,7 +98,7 @@ protected static function dispositionType( $mimeType )
return $mimeTypes[$mimeType];
}

return "attachment";
return $ini->variable( 'PassThroughSettings', 'DefaultContentDisposition' );
}
}

Expand Down
1 change: 1 addition & 0 deletions settings/file.ini
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ MaxCopyRetries=5
[PassThroughSettings]
# The default value for mime types not specified using ContentDisposition
# is "attachment". Possible values are attachment or inline.
DefaultContentDisposition=attachment
ContentDisposition[application/x-shockwave-flash]=inline
ContentDisposition[video/ogg]=inline
ContentDisposition[video/mp4]=inline
Expand Down

0 comments on commit bed5589

Please sign in to comment.