Merge pull request #13653 from nextcloud/backport/13650/stable15

[stable15] Fix colorizeSvg with transformations that contain a comma (,)
This commit is contained in:
Joas Schilling 2019-01-18 09:06:49 +01:00 committed by GitHub
commit 2c46aab893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -180,7 +180,7 @@ class IconsCacher {
*/
public function colorizeSvg($svg, $color): string {
// add fill (fill is not present on black elements)
$fillRe = '/<((circle|rect|path)((?!fill)[a-z0-9 =".\-#():;])+)\/>/mi';
$fillRe = '/<((circle|rect|path)((?!fill)[a-z0-9 =".\-#():;,])+)\/>/mi';
$svg = preg_replace($fillRe, '<$1 fill="#' . $color . '"/>', $svg);
// replace any fill or stroke colors