allow rendering of existing files

This commit is contained in:
Chris
2020-06-11 01:05:11 +02:00
parent 5861e73848
commit 3a6c987347

View File

@@ -79,6 +79,7 @@ function architect($url)
} }
} }
//we didn't find a hash. send error 404 //we didn't find a hash. send error 404
if($hash===false) if($hash===false)
{ {
@@ -109,7 +110,7 @@ function architect($url)
$extension = pathinfo($hash, PATHINFO_EXTENSION); $extension = pathinfo($hash, PATHINFO_EXTENSION);
foreach(loadAllContentControllers() as $cc) foreach(loadAllContentControllers(true) as $cc)
{ {
if(in_array($extension,(new $cc)->getRegisteredExtensions())) if(in_array($extension,(new $cc)->getRegisteredExtensions()))
{ {
@@ -473,10 +474,10 @@ function getStorageControllers()
return $controllers; return $controllers;
} }
function loadAllContentControllers() function loadAllContentControllers($all=false)
{ {
$allowedcontrollers = false; $allowedcontrollers = false;
if(defined('CONTENTCONTROLLERS') && CONTENTCONTROLLERS != '') if(defined('CONTENTCONTROLLERS') && CONTENTCONTROLLERS != '' && $all!==true)
{ {
$allowedcontrollers = array_map('strtolower', explode(',',CONTENTCONTROLLERS)); $allowedcontrollers = array_map('strtolower', explode(',',CONTENTCONTROLLERS));
} }