diff options
-rw-r--r-- | lib/private/Template/IconsCacher.php | 5 | ||||
-rw-r--r-- | tests/lib/Template/IconsCacherTest.php | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Template/IconsCacher.php b/lib/private/Template/IconsCacher.php index e5dd8633079..c91bf13ad53 100644 --- a/lib/private/Template/IconsCacher.php +++ b/lib/private/Template/IconsCacher.php @@ -112,7 +112,10 @@ class IconsCacher { foreach ($icons as $icon => $url) { $list .= "--$icon: url('$url');"; list($location,$color) = $this->parseUrl($url); - $svg = file_get_contents($location); + $svg = false; + if ($location !== '') { + $svg = file_get_contents($location); + } if ($svg === false) { $this->logger->debug('Failed to get icon file ' . $location); $data .= "--$icon: url('$url');"; diff --git a/tests/lib/Template/IconsCacherTest.php b/tests/lib/Template/IconsCacherTest.php index 33735e3a45e..c537323e0eb 100644 --- a/tests/lib/Template/IconsCacherTest.php +++ b/tests/lib/Template/IconsCacherTest.php @@ -104,7 +104,7 @@ class IconsCacherTest extends \Test\TestCase { public function testSetIconsFromValidCss() { $css = " icon.test { - --icon-test: url('/index.php/svg/core/actions/add/000?v=1'); + --icon-test: url('/index.php/svg/core/actions/add?color=000&v=1'); background-image: var(--icon-test); } "; @@ -127,7 +127,7 @@ class IconsCacherTest extends \Test\TestCase { public function testSetIconsFromValidCssMultipleTimes() { $css = " icon.test { - --icon-test: url('/index.php/svg/core/actions/add/000?v=1'); + --icon-test: url('/index.php/svg/core/actions/add?color=000&v=1'); background-image: var(--icon-test); } "; |