diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index 50e4ba4a2..16822b990 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -413,7 +413,7 @@ class Assets } $key = md5($asset); - if (is_string($asset) && !array_key_exists($key, $this->inline_css)) { + if ($asset && is_string($asset) && !array_key_exists($key, $this->inline_css)) { $this->inline_css[$key] = $data; } @@ -460,7 +460,7 @@ class Assets } $key = md5($asset); - if (is_string($asset) && !array_key_exists($key, $this->inline_js)) { + if ($asset && is_string($asset) && !array_key_exists($key, $this->inline_js)) { $this->inline_js[$key] = $data; } diff --git a/system/src/Grav/Common/Themes.php b/system/src/Grav/Common/Themes.php index add87d3be..4c5748be6 100644 --- a/system/src/Grav/Common/Themes.php +++ b/system/src/Grav/Common/Themes.php @@ -284,11 +284,11 @@ class Themes extends Iterator $class = substr($class, strlen($prefix)); // Replace namespace tokens to directory separators - $path = ltrim(preg_replace('#\\\|_(?!.+\\\)#', '/', $class), '/'); + $path = strtolower(ltrim(preg_replace('#\\\|_(?!.+\\\)#', '/', $class), '/')); $file = $locator->findResource("themes://{$path}/{$path}.php"); // Load class - if (stream_resolve_include_path($file)) { + if (file_exists($file)) { return include_once($file); } }