From 207b1b997f270d6f0f3572a65ee33447fe4629cd Mon Sep 17 00:00:00 2001 From: koshkoshka Date: Wed, 4 Aug 2021 17:03:09 +0300 Subject: [PATCH 1/6] Fix bug for PHP latest then 7.2 --- Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php index 279d589..0d9be50 100644 --- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -693,7 +693,7 @@ protected function parse_selector($selector_string) { // This implies that an html attribute specifier may start with an @ sign that is NOT captured by the expression. // farther study is required to determine of this should be documented or removed. // $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; - $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; + $pattern = "/([\w\-:\*]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is"; preg_match_all($pattern, trim($selector_string).' ', $matches, PREG_SET_ORDER); if (is_object($debugObject)) {$debugObject->debugLog(2, "Matches Array: ", $matches);} @@ -899,7 +899,7 @@ function get_display_size() { // Thanks to user gnarf from stackoverflow for this regular expression. $attributes = array(); - preg_match_all("/([\w-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER); + preg_match_all("/([\w\-]+)\s*:\s*([^;]+)\s*;?/", $this->attr['style'], $matches, PREG_SET_ORDER); foreach ($matches as $match) { $attributes[$match[1]] = $match[2]; } @@ -1375,7 +1375,7 @@ protected function read_tag() return true; } - if (!preg_match("/^[\w-:]+$/", $tag)) { + if (!preg_match("/^[\w\-:]+$/", $tag)) { $node->_[HDOM_INFO_TEXT] = '<' . $tag . $this->copy_until('<>'); if ($this->char==='<') { $this->link_nodes($node, false); From 1c2397fe8a4c5bbf4df59c795f41f0269e8e37b8 Mon Sep 17 00:00:00 2001 From: koshkoshka Date: Mon, 16 Aug 2021 10:26:52 +0300 Subject: [PATCH 2/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 49d9170..c019527 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "sunra/php-simple-html-dom-parser", + "name": "koshkoshka/php-simple-html-dom-parser", "type": "library", "description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.", "keywords": ["html", "dom", "parser"], From d11b4379531dc172edab379a79a232cbf1df322c Mon Sep 17 00:00:00 2001 From: koshkoshka Date: Mon, 16 Aug 2021 10:30:36 +0300 Subject: [PATCH 3/6] Update composer.json --- composer.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c019527..4bf125d 100644 --- a/composer.json +++ b/composer.json @@ -3,13 +3,17 @@ "type": "library", "description": "Composer adaptation of: A HTML DOM parser written in PHP5+ let you manipulate HTML in a very easy way! Require PHP 5+. Supports invalid HTML. Find tags on an HTML page with selectors just like jQuery. Extract contents from HTML in a single line.", "keywords": ["html", "dom", "parser"], - "homepage": "https://github.com/sunra/php-simple-html-dom-parser", + "homepage": "https://github.com/koshkoshka/php-simple-html-dom-parser", "license": "MIT", "authors": [ { "name": "S.C. Chen", "homepage": "http://sourceforge.net/projects/simplehtmldom/" }, + { + "name": "Andrey Koshkosh", + "homepage": "https://service-kuntsevo.ru" + }, { "name": "Sunra", "email": "sunra@yandex.ru", @@ -20,6 +24,9 @@ "php": ">=5.3.2", "ext-mbstring": "*" }, + "replace": { + "sunra/php-simple-html-dom-parser": "*" + }, "autoload": { "psr-0": { "Sunra\\PhpSimple\\HtmlDomParser": "Src/" } } From 5b9e4eebd79a32e7bb555c0638c048b55f5b15c6 Mon Sep 17 00:00:00 2001 From: koshkoshka Date: Mon, 16 Aug 2021 10:31:01 +0300 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 945a683..a513073 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Install composer.phar ```json "require": { - "sunra/php-simple-html-dom-parser": "1.5.2" + "koshkoshka/php-simple-html-dom-parser": "1.5.2" } ``` From ecdf6d3990790faff592d5f594c73dc0ea017729 Mon Sep 17 00:00:00 2001 From: koshkoshka Date: Mon, 16 Aug 2021 10:32:59 +0300 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a513073..5c22f06 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Install composer.phar ```json "require": { - "koshkoshka/php-simple-html-dom-parser": "1.5.2" + "koshkoshka/php-simple-html-dom-parser": "1.5.3" } ``` From c6eb0657c31493779dedd38de8a02aef420d53d4 Mon Sep 17 00:00:00 2001 From: koshkoshka Date: Mon, 16 Aug 2021 10:33:38 +0300 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c22f06..52c1182 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ php-simple-html-dom-parser ========================== -Version 1.5.2 +Version 1.5.3 Adaptation for Composer and PSR-0 of: