From 06554e44a86cb280c1ce9018966396b4e20a4032 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 2 Sep 2016 18:59:34 +0200 Subject: [PATCH] throw 404 on notfound --- htdocs/application/controllers/Theme_assets.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/htdocs/application/controllers/Theme_assets.php b/htdocs/application/controllers/Theme_assets.php index 9df9c11..a6d084f 100644 --- a/htdocs/application/controllers/Theme_assets.php +++ b/htdocs/application/controllers/Theme_assets.php @@ -206,6 +206,14 @@ class Theme_assets extends CI_Controller $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 header('Content-Type: application/x-javascript; charset=utf-8'); $this->_expires_header(30);