throw 404 on notfound

This commit is contained in:
Claude 2016-09-02 18:59:34 +02:00
parent 285ecd724a
commit 06554e44a8

View File

@ -206,6 +206,14 @@ class Theme_assets extends CI_Controller
$file_path = 'themes/default/js/' . $js_file; $file_path = 'themes/default/js/' . $js_file;
} }
// return empty string if not found, to not mess up existing JS
if (!file_exists($file_path))
{
header('HTTP/1.1 404 Not Found');
return '';
}
//send //send
header('Content-Type: application/x-javascript; charset=utf-8'); header('Content-Type: application/x-javascript; charset=utf-8');
$this->_expires_header(30); $this->_expires_header(30);