Endless parsing
clxo opened this issue · 1 comments
clxo commented
Hi!
The JSON-LD micrometa 2 parser can't finish if the url of @id and http://schema.org/sameAs property is the same.
I used the following script for testing:
<?php
require_once 'vendor/autoload.php';
use Jkphl\Micrometa\Ports\Parser;
$htmlSource_jsonld = '<!DOCTYPE html>
<html>
<head>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "organization",
"@id": "http://www.website.de",
"sameAs": "http://www.website.de"
}
</script>
</head>
<body></body>
</html>';
$time_start = microtime(true);
$objMicrometa = new Parser();
$result = $objMicrometa("http://www.website.de", $htmlSource_jsonld);
$time_end = microtime(true);
$time = $time_end - $time_start;
echo "\n $time Seconds Runtime";
clxo commented