I would like to report an issue I found in the latest version of Readability.php. The error I got is the following:
PHP message: PHP Fatal error: Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in /vendor/fivefilters/readability.php/src/Readability.php:372
The $parsed['@context'] seems to be an array instead of being a string. Adding an extra condition right before the erroneous line might fix the issue: !is_string($parsed['@context']) ||
Hello,
We just found another fatal error that occurs from time to time for us:
PHP Fatal error: Uncaught TypeError: fivefilters\Readability\Readability::textSimilarity(): Argument #1 ($textA) must be of type string, null given, called in /vendor/fivefilters/readability.php/src/Readability.php on line 2143 and defined in /vendor/fivefilters/readability.php/src/Readability.php:994
PHP Fatal error: Uncaught TypeError: fivefilters\Readability\Readability::postProcessContent(): Argument #1 ($article) must be of type fivefilters\Readability\Nodes\DOM\DOMDocument, bool given, called in /vendor/fivefilters/readability.php/src/Readability.php on line 258 and defined in /vendor/fivefilters/readability.php/src/Readability.php:2186
Thanks for reporting this. We’re going to look into the errors. Are you able to provide an article URL or HTML file that results in this error in Readability.php?