check if hook returns null

in that case run the default operation
This commit is contained in:
Uwe Steinmann 2016-11-22 09:20:12 +01:00
parent 4e92b9e0d3
commit d70deddd2f
2 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ class SeedDMS_Controller_Download extends SeedDMS_Controller_Common {
switch($type) {
case "version":
if(!$this->callHook('version')) {
if(null === $this->callHook('version')) {
if(file_exists($dms->contentDir . $content->getPath())) {
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . filesize($dms->contentDir . $content->getPath() ));

View File

@ -31,7 +31,7 @@ class SeedDMS_Controller_ViewOnline extends SeedDMS_Controller_Common {
switch($type) {
case "version":
if(!$this->callHook('version')) {
if(null === $this->callHook('version')) {
header("Content-Type: " . $content->getMimeType());
if (!isset($settings->_viewOnlineFileTypes) || !is_array($settings->_viewOnlineFileTypes) || !in_array(strtolower($content->getFileType()), $settings->_viewOnlineFileTypes)) {
header("Content-Disposition: filename=\"" . $document->getName().$content->getFileType()) . "\"";