Skip to content

Commit

Permalink
Remove invalid condition around image href validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bsweeney committed Feb 7, 2024
1 parent 8ffcc41 commit 732faa9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Svg/Tag/Image.php
Expand Up @@ -58,14 +58,12 @@ public function start($attributes)

$this->document->getSurface()->transform(1, 0, 0, -1, 0, $height);

if ($from === "font-family") {
$scheme = \strtolower(parse_url($this->href, PHP_URL_SCHEME) ?: "");
if (
$scheme === "phar" || \strtolower(\substr($this->href, 0, 7)) === "phar://"
|| ($this->document->allowExternalReferences === false && $scheme !== "data")
) {
return;
}
$scheme = \strtolower(parse_url($this->href, PHP_URL_SCHEME) ?: "");
if (
$scheme === "phar" || \strtolower(\substr($this->href, 0, 7)) === "phar://"
|| ($this->document->allowExternalReferences === false && $scheme !== "data")
) {
return;
}

$this->document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height);
Expand Down

0 comments on commit 732faa9

Please sign in to comment.