Skip to content

Commit

Permalink
SVG parsing - comparing the tag name in a case insensitive way
Browse files Browse the repository at this point in the history
This patch will avoid bypassing the uri validation if the tag name have some uppercased letters.
  • Loading branch information
Blaklis authored and bsweeney committed Jan 31, 2023
1 parent ae1ca4a commit 7558f07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Image/Cache.php
Expand Up @@ -133,7 +133,7 @@ static function resolve_url($url, $protocol, $host, $base_path, Options $options
xml_set_element_handler(
$parser,
function ($parser, $name, $attributes) use ($options, $parsed_url, $full_url) {
if ($name === "image") {
if (strtolower($name) === "image") {
$attributes = array_change_key_case($attributes, CASE_LOWER);
$url = $attributes["xlink:href"] ?? $attributes["href"];
if (!empty($url)) {
Expand Down

0 comments on commit 7558f07

Please sign in to comment.