Skip to content

Conversation

@brianlmoon
Copy link
Contributor

The LinkedData class was only grabbing the first application/ld+json
script tag found in the DOM. It now finds them all and makes them
all available via the getAll method. Additionally, it inspects the
mainEntityOfPage property of the json nodes and if a match is found
with the request URI, that node is assigned as the default node
rather than the first node found.

The LinkedData class was only grabbing the first application/ld+json
script tag found in the DOM. It now finds them all and makes them
all available via the getAll method. Additionally, it inspects the
mainEntityOfPage property of the json nodes and if a match is found
with the request URI, that node is assigned as the default node
rather than the first node found.
@oscarotero
Copy link
Collaborator

Thanks!
Running the tests, it seems that PHP 8.1 treats some characters in JSON-LD differently.

@brianlmoon
Copy link
Contributor Author

I will have a look at 8.1, thanks.

@brianlmoon
Copy link
Contributor Author

Yep, the default flags for html_entity_decode changed in PHP 8.1

 flags changed from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401. 

@brianlmoon
Copy link
Contributor Author

Tested on 8.0 and 8.1. I don't have 7.4 anywhere around to test with though. Hopefully it passes OK as well with this change.

@oscarotero oscarotero merged commit 530593a into php-embed:master Jun 28, 2023
@oscarotero
Copy link
Collaborator

thanks! the tests keep failing but it's due a different issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants