spekulatius / PHPScraper

A universal web-util for PHP.
https://phpscraper.de
GNU General Public License v3.0
520 stars 73 forks source link

Getting Deprecated: strpos() error in PHP PHP 8.1.8 #86

Closed khanakia closed 2 years ago

khanakia commented 2 years ago

I am using this example https://phpscraper.de/examples/extract-keywords.html with PHP 8.1.8

Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /Users/khanakia/D1/www/php/scrap_php/vendor/spekulatius/phpscraper/src/phpscraper.php on line 858
PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /Users/khanakia/D1/www/php/scrap_php/vendor/spekulatius/phpscraper/src/phpscraper.php on line 859
spekulatius commented 2 years ago

Hey @khanakia,

oh, that's interesting. I have hardened the strpos calls better. Can you run composer update and try the latest version 0.6.1?

Cheers, Peter

khanakia commented 2 years ago

will check

spekulatius commented 2 years ago

Did you have a chance to try this @khanakia ?

khanakia commented 2 years ago

@spekulatius It's working fine now with 0.6.1 :)

spekulatius commented 2 years ago

Awesome! Thank you for checking!