Skip to content
New issue

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

Escaping regular expression to work with php-7.* #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sptutusukanta
Copy link

Due to the breaking change the regular expressions don't work anymore. Also, since PHP 7.1 it is possible to interpret negative offset.

Check:
https://stackoverflow.com/questions/24764212/preg-match-compilation-failed-invalid-range-in-character-class-at-offset
https://stackoverflow.com/questions/47214416/dont-parse-simple-html-dom-on-php-7-1
https://sourceforge.net/p/simplehtmldom/bugs/161/

This commit fixes those issues. [Tested with php-7.4]

Due to the breaking change the regular expressions don't work anymore. Also, since PHP 7.1 it is possible to interpret negative offset.

Check: 
https://stackoverflow.com/questions/24764212/preg-match-compilation-failed-invalid-range-in-character-class-at-offset
https://stackoverflow.com/questions/47214416/dont-parse-simple-html-dom-on-php-7-1
https://sourceforge.net/p/simplehtmldom/bugs/161/

This commit fixes those issues. [Tested with php-7.4]
@SaliBhdr
Copy link

I came across this problem too and it seems all the changes @sptutusukanta applied are correct. These changes make the package compatible with PHP 7.*. When is this pull request going to be merged to master and make a release?

@sptutusukanta
Copy link
Author

Hello @SaliBhdr, it seems like this repo is no more maintained by anyone & abandoned. So, I already found another package which is still maintained and is quite a drop-in replacement of this package.

Check this out: https://github.com/Kub-AT/php-simple-html-dom-parser
You may install it with:

composer require kub-at/php-simple-html-dom-parser

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