Skip to content

Commit

Permalink
Merge pull request #10415 from nextcloud/bugfix/noid/regex-icons
Browse files Browse the repository at this point in the history
Fix regex for icon urls
  • Loading branch information
rullzer authored Jul 27, 2018
2 parents 6ccc34f + f77cc11 commit 7b23cf3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 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
2 changes: 1 addition & 1 deletion tests/lib/Template/IconsCacherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function testGetIconsFromValidCss() {
";
$actual = self::invokePrivate($this->iconsCacher, 'getIconsFromCss', [$css]);
$expected = array(
'icon-test' => '/svg/core/actions/add/000'
'icon-test' => '/svg/core/actions/add/000?v=1'
);
$this->assertEquals($expected, $actual);
}
Expand Down

0 comments on commit 7b23cf3

Please sign in to comment.