diff --git a/README.md b/README.md index 945a683..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: @@ -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.3" } ``` 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); diff --git a/composer.json b/composer.json index 49d9170..4bf125d 100644 --- a/composer.json +++ b/composer.json @@ -1,15 +1,19 @@ { - "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"], - "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/" } }