Skip to content

Commit

Permalink
(test: minor change)
Browse files Browse the repository at this point in the history
Simple HTML DOM Parser の MAX_FILE_SIZE を大きな値 600MB に変更した。
  • Loading branch information
tomk79 committed Aug 31, 2020
1 parent bb59b07 commit 4fda384
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/libs/simple_html_dom.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand All @@ -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;
Expand Down

0 comments on commit 4fda384

Please sign in to comment.