feat(extra-features): Use word boundary to avoid matching patrial attr.

(e.g., width vs stroke-width)
This commit is contained in:
2025-12-31 14:49:46 +01:00
parent e2c4f265c2
commit afc3ea26c4

View File

@ -245,7 +245,7 @@ class SmartyHelperFunctions
$value = $params[$attr]; $value = $params[$attr];
// Check if attribute already exists in the SVG // Check if attribute already exists in the SVG
if (preg_match('/' . preg_quote($attr) . '="[^"]*"/', $svg_content)) { if (preg_match('/\b' . preg_quote($attr) . '="[^"]*"/', $svg_content)) {
// Replace existing attribute // Replace existing attribute
$svg_content = preg_replace( $svg_content = preg_replace(
'/' . preg_quote($attr) . '="[^"]*"/', '/' . preg_quote($attr) . '="[^"]*"/',