From 4fda384246a7a6bee1be0afe17086a96c996ec88 Mon Sep 17 00:00:00 2001 From: Tomoya Koyanagi Date: Tue, 1 Sep 2020 01:44:06 +0900 Subject: [PATCH] (test: minor change) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Simple HTML DOM Parser の MAX_FILE_SIZE を大きな値 600MB に変更した。 --- tests/libs/simple_html_dom.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/libs/simple_html_dom.php b/tests/libs/simple_html_dom.php index 366e0620..7053367f 100644 --- a/tests/libs/simple_html_dom.php +++ b/tests/libs/simple_html_dom.php @@ -63,7 +63,8 @@ if(!defined('DEFAULT_TARGET_CHARSET')){ define('DEFAULT_TARGET_CHARSET', 'UTF-8'); } if(!defined('DEFAULT_BR_TEXT')) { define('DEFAULT_BR_TEXT', "\r\n"); } if(!defined('DEFAULT_SPAN_TEXT')) { define('DEFAULT_SPAN_TEXT', " "); } -if(!defined('MAX_FILE_SIZE')) { define('MAX_FILE_SIZE', 600000); } +// if(!defined('MAX_FILE_SIZE')) { define('MAX_FILE_SIZE', 600*1000*1000); } + // helper functions // ----------------------------------------------------------------------------- // get html dom from file @@ -76,7 +77,7 @@ 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); - if (empty($contents) || strlen($contents) > MAX_FILE_SIZE) + if (empty($contents) || strlen($contents) > 600*1000*1000) { return false; } @@ -89,7 +90,7 @@ function file_get_html($url, $use_include_path = false, $context=null, $offset = function str_get_html($str, $lowercase=true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT, $defaultSpanText=DEFAULT_SPAN_TEXT) { $dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $stripRN, $defaultBRText, $defaultSpanText); - if (empty($str) || strlen($str) > MAX_FILE_SIZE) + if (empty($str) || strlen($str) > 600*1000*1000) { $dom->clear(); return false;