From 5f05fbd5687d91bfa237227afd05b176283094ed Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 12:50:26 +0300 Subject: [PATCH 1/9] Release 1.5.0 stable No issues. all work fine - it is time to mark as stable --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index ad1a52a..5fc3ed2 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "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.", "version": "1.5.0", + "tags": "release", "keywords": ["html", "dom", "parser"], "homepage": "https://github.com/sunra/php-simple-html-dom-parser", "license": "MIT", From 5c08d3550c8aa8876792726fcf061e56517bb0e3 Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 12:58:39 +0300 Subject: [PATCH 2/9] trying to understand how to make stable composer package --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5fc3ed2..aa68994 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "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.", "version": "1.5.0", - "tags": "release", + "tags": "1.5.0", "keywords": ["html", "dom", "parser"], "homepage": "https://github.com/sunra/php-simple-html-dom-parser", "license": "MIT", From a4f8c8abcff18e32ea7c161d3d7e2e2fb1e7972d Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 13:06:32 +0300 Subject: [PATCH 3/9] ohh how make it stable?! --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index aa68994..876536a 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "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.", "version": "1.5.0", - "tags": "1.5.0", + "tags": "stable", "keywords": ["html", "dom", "parser"], "homepage": "https://github.com/sunra/php-simple-html-dom-parser", "license": "MIT", From 16d7275b5ec360502e75099a9e991b50312dee83 Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 13:12:52 +0300 Subject: [PATCH 4/9] Stable) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 876536a..106ab35 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "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.", "version": "1.5.0", - "tags": "stable", + "tags": "v1.5.0", "keywords": ["html", "dom", "parser"], "homepage": "https://github.com/sunra/php-simple-html-dom-parser", "license": "MIT", From df2570a16f3b30b4cb1a74447c88441d4c12f27e Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 13:20:19 +0300 Subject: [PATCH 5/9] stable 2 --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 106ab35..4bbb9da 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "sunra/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.", - "version": "1.5.0", "tags": "v1.5.0", "keywords": ["html", "dom", "parser"], "homepage": "https://github.com/sunra/php-simple-html-dom-parser", From a0b80ace086c7e09085669205e1b3c2c9c7a453c Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 17:32:03 +0300 Subject: [PATCH 6/9] trying to mark stable for composer --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 4bbb9da..6d21ae1 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,7 @@ { "name": "sunra/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.", - "tags": "v1.5.0", + "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", "license": "MIT", From fd9bd4ec4f6678bed423e2c8425dbb8eca910e22 Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 22:18:27 +0300 Subject: [PATCH 7/9] readme updated for 1.5.0 stable composer's packet --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bb1f8f..646468c 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,9 @@ http://simplehtmldom.sourceforge.net/ Install ------- - composer.phar require - - package name: "sunra/php-simple-html-dom-parser": "dev-master" + composer.phar + require + "sunra/php-simple-html-dom-parser": "v1.5.0" Usage From 691f701e814302deabb1c721fed7c05663704fa8 Mon Sep 17 00:00:00 2001 From: sunra Date: Sat, 4 May 2013 22:23:02 +0300 Subject: [PATCH 8/9] readme updated --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 646468c..1fb2302 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,12 @@ http://simplehtmldom.sourceforge.net/ Install ------- - composer.phar - require - "sunra/php-simple-html-dom-parser": "v1.5.0" - + composer.phar +```json +"require": { + "sunra/php-simple-html-dom-parser": "v1.5.0" + } +``` Usage ----- From 04e4b1e0eed02dfb25ecf850b2b533f29ce1e8d2 Mon Sep 17 00:00:00 2001 From: Stefan Hasenstab Date: Mon, 26 Aug 2013 16:51:56 +0200 Subject: [PATCH 9/9] convert content to valid utf8 --- Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php | 5 +++++ 1 file changed, 5 insertions(+) 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 9a7b2f6..c44a604 100644 --- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -75,6 +75,11 @@ function file_get_html($url, $use_include_path = false, $context=null, $offset = $contents = file_get_contents($url, $use_include_path, $context, $offset); // Paperg - use our own mechanism for getting the contents as we want to control the timeout. //$contents = retrieve_url_contents($url); + + //convert contents to utf8 + $contents = mb_convert_encoding($contents, 'UTF-8', + mb_detect_encoding($contents, 'UTF-8, ISO-8859-1', true)); + if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) { return false;