diff --git a/src/includes/routes.php b/src/includes/routes.php index 169a7382..966946f1 100644 --- a/src/includes/routes.php +++ b/src/includes/routes.php @@ -311,11 +311,12 @@ LSurl :: add_handler('#^favicon\.ico#', 'handle_favicon_ico_view', false, true, function handle_libs_file($request) { $path = LStemplate :: getLibFilePath($request -> file); if ($path && is_file($path)) { - switch (strtolower(substr($path, -4))) { - case '.css': + $info = new SplFileInfo($path); + switch ($info -> getExtension()) { + case 'css': $mime_type = 'text/css'; break; - case '.js': + case 'js': $mime_type = 'text/javascript'; break; default: