Skip to content

Commit

Permalink
Fix regex for icon urls
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
juliusknorr committed Jul 26, 2018
1 parent 6514bf1 commit 8aa0f04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/img/actions/star-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions lib/private/Template/IconsCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -101,7 +101,7 @@ public function setIconsCss(string $css) {

$data = '';
foreach ($icons as $icon => $url) {
$data .= "--$icon: url('$url?v=1');";
$data .= "--$icon: url('$url');";
}

if (strlen($data) > 0) {
Expand Down

0 comments on commit 8aa0f04

Please sign in to comment.