Fix colorizeSvg with transformations that contain a comma (,)

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-01-17 14:24:07 +01:00
parent cff89c2a44
commit adbeb42c2c
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA

View file

@ -185,7 +185,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