Skip to content

Commit

Permalink
Data: fix Meta/Tag::toHtml (#40110)
Browse files Browse the repository at this point in the history
  • Loading branch information
klees committed May 17, 2024
1 parent 7057907 commit adb487a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Data/Meta/Html/OpenGraph/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct(

public function toHtml(): string
{
return "<meta property=\"$this->property_name\" content=\"{$this->getValue()}\" />";
return "<meta property=\"" . htmlspecialchars($this->property_name) . "\" content=\"" . htmlspecialchars($this->getValue()) . "\" />";
}

abstract protected function getValue(): string;
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Meta/Html/UserDefined.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
*/
public function toHtml(): string
{
return "<meta name=\"$this->key\" content=\"$this->value\" />";
return "<meta name=\"" . htmlspecialchars($this->key) . "\" content=\"" . htmlspecialchars($this->value) . "\" />";
}

public function getKey(): string
Expand Down

0 comments on commit adb487a

Please sign in to comment.