Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for EZP-20741: Allow default content disposition to be overridden #614

Merged
merged 3 commits into from Sep 24, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Expand Up @@ -87,6 +87,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