We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi (you generator is very usefull, thanks)
I would like to know your opinion about the following use case:
As end user, I have html special char (like '<') into LD-JSON attributes
I write a little php script to represent the case:
<?php require_once `vendor/autoload.php'; $context = \JsonLd\Context::create('news_article', [ 'headline' => 'Article headline', 'description' => 'A terrible </script> here' ]); echo $context; echo "\n\nAn other way :\n\n"; $context = \JsonLd\Context::create('news_article', [ 'headline' => 'Article headline', 'description' => htmlspecialchars('A terrible </script> here') ]); echo $context;
Script output the following:
<script type="application/ld+json">{"@context":"http:\/\/schema.org","@type":"NewsArticle","headline":"Article headline","description":"A terrible <\/script> here"}</script> An other way : <script type="application/ld+json">{"@context":"http:\/\/schema.org","@type":"NewsArticle","headline":"Article headline","description":"A terrible <\/script> here"}</script>
You should notice that the first sample output an invalid HTML
I had created dedicated html page to show the escape issue: https://gist.github.com/boly38/77164ae66055b596d75f62d789a4266a
I'm asking myself about where htmlspecialchars should be ?
htmlspecialchars
what do you think?
As end-user, would be great that the library manages that point for me as, per specification, toString result is ready to embed html script.
thanks
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
(you generator is very usefull, thanks)
I would like to know your opinion about the following use case:
I write a little php script to represent the case:
Script output the following:
You should notice that the first sample output an invalid HTML
I had created dedicated html page to show the escape issue:
https://gist.github.com/boly38/77164ae66055b596d75f62d789a4266a
I'm asking myself about where
htmlspecialchars
should be ?what do you think?
As end-user, would be great that the library manages that point for me as, per specification, toString result is ready to embed html script.
thanks
The text was updated successfully, but these errors were encountered: