diff --git a/src/php/File/SvgFile.php b/src/php/File/SvgFile.php index 82f1ef9..96e3102 100644 --- a/src/php/File/SvgFile.php +++ b/src/php/File/SvgFile.php @@ -173,9 +173,9 @@ public function crop($srcPath, $destPath, $method, $coords, $rotation) $openingElm = '<' . $reader->name; $closingElm = 'name . '>'; - $openingElm .= ' width="' . htmlspecialchars( $coords['width'], ENT_XML1 ) . '"'; - $openingElm .= ' height="' . htmlspecialchars( $coords['height'], ENT_XML1 ) . '"'; - $openingElm .= ' viewBox="' . htmlspecialchars( $newViewBox, ENT_XML1 ) . '"'; + $openingElm .= ' width="' . htmlspecialchars( $coords['width'], ENT_XML1 | ENT_QUOTES ) . '"'; + $openingElm .= ' height="' . htmlspecialchars( $coords['height'], ENT_XML1 | ENT_QUOTES ) . '"'; + $openingElm .= ' viewBox="' . htmlspecialchars( $newViewBox, ENT_XML1 | ENT_QUOTES ) . '"'; while( $reader->moveToNextAttribute() ) { if ( $reader->namespaceURI === '' && @@ -183,7 +183,7 @@ public function crop($srcPath, $destPath, $method, $coords, $rotation) continue; } $openingElm .= ' ' . $reader->name . '='; - $openingElm .= '"' . htmlspecialchars( $reader->value, ENT_XML1 ) . '"'; + $openingElm .= '"' . htmlspecialchars( $reader->value, ENT_XML1 | ENT_QUOTES ) . '"'; } $openingElm .= '>';