From f8d0cb0302cb86f05ab030841bf4a6f40911d0ff Mon Sep 17 00:00:00 2001 From: Sebastian van Dijk Date: Tue, 19 Jun 2018 10:42:02 +0200 Subject: [PATCH 1/2] error handling: add @ to file_get_contents, will return false if file_get_contents fails --- Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..6fda56a 100644 --- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -78,7 +78,7 @@ function file_get_html($url, $use_include_path = false, $context=null, $offset=0 // We DO force the tags to be terminated. $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); // For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done. - $contents = file_get_contents($url, $use_include_path, $context, $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); if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) From b634e6b7976b57a43b92fe8dbc44f271bdbf6921 Mon Sep 17 00:00:00 2001 From: Sebastian van Dijk Date: Tue, 19 Jun 2018 11:09:01 +0200 Subject: [PATCH 2/2] update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 49d9170..7b814d0 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "sunra/php-simple-html-dom-parser", + "name": "svandijk/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"],