diff --git a/src/Data/Meta/Html/OpenGraph/Tag.php b/src/Data/Meta/Html/OpenGraph/Tag.php
index ee753566cec0..f723c9b98efd 100644
--- a/src/Data/Meta/Html/OpenGraph/Tag.php
+++ b/src/Data/Meta/Html/OpenGraph/Tag.php
@@ -33,7 +33,7 @@ public function __construct(
public function toHtml(): string
{
- return "property_name\" content=\"{$this->getValue()}\" />";
+ return "property_name) . "\" content=\"" . htmlspecialchars($this->getValue()) . "\" />";
}
abstract protected function getValue(): string;
diff --git a/src/Data/Meta/Html/UserDefined.php b/src/Data/Meta/Html/UserDefined.php
index bceee2649ce4..847a9111a29b 100644
--- a/src/Data/Meta/Html/UserDefined.php
+++ b/src/Data/Meta/Html/UserDefined.php
@@ -37,7 +37,7 @@ public function __construct(
*/
public function toHtml(): string
{
- return "key\" content=\"$this->value\" />";
+ return "key) . "\" content=\"" . htmlspecialchars($this->value) . "\" />";
}
public function getKey(): string