php-simple-html-dom-parser icon indicating copy to clipboard operation
php-simple-html-dom-parser copied to clipboard

PHP 7.4

Open Quadratica opened this issue 4 years ago • 6 comments

Does the library work with PHP 7.4 ? Cause i get some error, in the past i already used the Php Simple Html Parser and everything was all right.

Quadratica avatar Oct 07 '20 11:10 Quadratica

Hi there. Getting exception preg_match(): Compilation failed: invalid range in character class at offset 4 on php 7.4. Anyone else got that?

malsatin avatar Dec 07 '20 00:12 malsatin

Same here, it doesn't work! Found out that this project is abandoned. Use this fork instead.

Kub-AT/php-simple-html-dom-parser

mce1978 avatar Jan 07 '21 20:01 mce1978

Thank you

Quadratica avatar Jan 31 '21 18:01 Quadratica

Just a \ needs to be added before all the hyphens in the regex defined in file simple_html_dom.php ( 2 lines to be specific )

prayal1711 avatar Jun 15 '21 18:06 prayal1711

The fix has yet to be implemented into the repo. Had to manually edit the source scrip to get rid of the error. Don't think this fix will get added in as the repo hasn't been updated in years....

Had to add a \ infront of all the - hyphens on here:

$pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";

if (!preg_match("/^[\w-:]+$/", $tag))

GitIDHere avatar Jul 14 '21 14:07 GitIDHere

Thanh you

minhvuong0505 avatar Sep 28 '22 11:09 minhvuong0505