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

Sunra\PhpSimple\HtmlDomParser doesn't work on PHP 7.4.29 #16

Closed
rdmpage opened this issue Jun 26, 2022 · 2 comments
Closed

Sunra\PhpSimple\HtmlDomParser doesn't work on PHP 7.4.29 #16

rdmpage opened this issue Jun 26, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@rdmpage
Copy link
Owner

rdmpage commented Jun 26, 2022

Sunra\PhpSimple\HtmlDomParser doesn't work on more recent versions of PHP (e.g., 7.4.29) throwing regular expression compilation errors. This is a know bug (see e.g. sunra/php-simple-html-dom-parser#87) and there is at least one pull request to fix it (e.g., sunra/php-simple-html-dom-parser#88) but looks like development has basically stopped so I can't simply update composer.json.

@rdmpage rdmpage added the bug Something isn't working label Jun 26, 2022
@rdmpage
Copy link
Owner Author

rdmpage commented Jun 26, 2022

Fix is to remove from composer.json and add relevant files to repository:

|
+-- HtmlDomParser.php
|
+--simplehtmldom_1_5
   |
   +-- simple_html_dom.php

Then patch simple_html_dom.php. To include the class we simply:

require_once (dirname(__FILE__) . '/HtmlDomParser.php');

This loads the patched version of the code.

@rdmpage
Copy link
Owner Author

rdmpage commented Jun 26, 2022

Fixed with c1fb32b

@rdmpage rdmpage closed this as completed Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant