parent
4b7ef668a4
commit
34a71f57fc
|
@ -112,7 +112,10 @@ class IconsCacher {
|
||||||
foreach ($icons as $icon => $url) {
|
foreach ($icons as $icon => $url) {
|
||||||
$list .= "--$icon: url('$url');";
|
$list .= "--$icon: url('$url');";
|
||||||
list($location,$color) = $this->parseUrl($url);
|
list($location,$color) = $this->parseUrl($url);
|
||||||
$svg = file_get_contents($location);
|
$svg = false;
|
||||||
|
if ($location !== '') {
|
||||||
|
$svg = file_get_contents($location);
|
||||||
|
}
|
||||||
if ($svg === false) {
|
if ($svg === false) {
|
||||||
$this->logger->debug('Failed to get icon file ' . $location);
|
$this->logger->debug('Failed to get icon file ' . $location);
|
||||||
$data .= "--$icon: url('$url');";
|
$data .= "--$icon: url('$url');";
|
||||||
|
|
|
@ -104,7 +104,7 @@ class IconsCacherTest extends \Test\TestCase {
|
||||||
public function testSetIconsFromValidCss() {
|
public function testSetIconsFromValidCss() {
|
||||||
$css = "
|
$css = "
|
||||||
icon.test {
|
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);
|
background-image: var(--icon-test);
|
||||||
}
|
}
|
||||||
";
|
";
|
||||||
|
@ -127,7 +127,7 @@ class IconsCacherTest extends \Test\TestCase {
|
||||||
public function testSetIconsFromValidCssMultipleTimes() {
|
public function testSetIconsFromValidCssMultipleTimes() {
|
||||||
$css = "
|
$css = "
|
||||||
icon.test {
|
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);
|
background-image: var(--icon-test);
|
||||||
}
|
}
|
||||||
";
|
";
|
||||||
|
|
Loading…
Reference in New Issue