Skip to content

Commit

Permalink
Merge pull request #46 from dachcom-digital/schema_encoding_fix
Browse files Browse the repository at this point in the history
Schema encoding fix
  • Loading branch information
solverat committed Apr 3, 2023
2 parents 0d0f89b + 24efdc9 commit d65d24a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions UPGRADE.md
@@ -1,5 +1,8 @@
# Upgrade Notes

## 2.2.0
- [BUGFIX] fix encoding in schema json validation process [#45](https://github.com/dachcom-digital/pimcore-seo/issues/45)

## 2.1.0
- [BUGFIX] Fix Array Merge Process [#32](https://github.com/dachcom-digital/pimcore-seo/issues/32)
- [BUGFIX] Avoid triggering deprecation message on isMasterRequest() [#36](https://github.com/dachcom-digital/pimcore-seo/pull/36)
Expand Down
4 changes: 3 additions & 1 deletion src/SeoBundle/MetaData/Integrator/SchemaIntegrator.php
Expand Up @@ -250,7 +250,9 @@ protected function validateJsonLd(string $jsonLdData): bool|array
$dom->formatOutput = false;

libxml_use_internal_errors(1);
$dom->loadHTML($jsonLdData);

$dom->loadHTML(sprintf('%s%s', '<?xml encoding="UTF-8">', $jsonLdData));

$xpath = new \DOMXPath($dom);
$jsonScripts = $xpath->query('//script[@type="application/ld+json"]');

Expand Down

0 comments on commit d65d24a

Please sign in to comment.