Fix regex for icon urls

Use the version from the url rather than hardcoding v=1.
Also allow uppercase chars in the url, so that uppercase
hex color values will also be included

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/10415/head
Julius Härtl 8 years ago
parent 6514bf1e18
commit 8aa0f0485d
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
  1. 2
      core/img/actions/star-dark.svg
  2. 4
      lib/private/Template/IconsCacher.php

@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 16" width="16" height="16"><path d="m8 0.5 2.2 5.3 5.8 0.45-4.5 3.75 1.5 5.5-5-3.1-5 3.1 1.5-5.5-4.5-3.75 5.8-0.45z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 16" width="16" height="16"><path d="m8 0.5 2.2 5.3 5.8 0.45-4.5 3.75 1.5 5.5-5-3.1-5 3.1 1.5-5.5-4.5-3.75 5.8-0.45z" fill="#000"/></svg>

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 207 B

@ -47,7 +47,7 @@ class IconsCacher {
protected $urlGenerator;
/** @var string */
private $iconVarRE = '/--(icon-[a-zA-Z0-9-]+): url\(["\']([a-z0-9-_\~\/\.]+)[^;]+;/m';
private $iconVarRE = '/--(icon-[a-zA-Z0-9-]+): url\(["\']([a-zA-Z0-9-_\~\/\.\?\=]+)[^;]+;/m';
/** @var string */
private $fileName = 'icons-vars.css';
@ -101,7 +101,7 @@ class IconsCacher {
$data = '';
foreach ($icons as $icon => $url) {
$data .= "--$icon: url('$url?v=1');";
$data .= "--$icon: url('$url');";
}
if (strlen($data) > 0) {

Loading…
Cancel
Save