mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-04 18:14:44 +02:00
feat: extract simple_html_dom max_file_size to config (#4395)
This commit is contained in:
parent
48cb7d71ed
commit
1d02214e12
4 changed files with 12 additions and 13 deletions
|
@ -7,10 +7,6 @@ if (is_file(__DIR__ . '/../vendor/autoload.php')) {
|
|||
const PATH_LIB_CACHES = __DIR__ . '/../caches/';
|
||||
const PATH_CACHE = __DIR__ . '/../cache/';
|
||||
|
||||
// Allow larger files for simple_html_dom
|
||||
// todo: extract to config (if possible)
|
||||
const MAX_FILE_SIZE = 10000000;
|
||||
|
||||
// Files
|
||||
$files = [
|
||||
__DIR__ . '/../lib/html.php',
|
||||
|
|
|
@ -114,8 +114,9 @@ function str_get_html(
|
|||
if (empty($str)) {
|
||||
throw new \Exception('Refusing to parse empty string input');
|
||||
}
|
||||
if (strlen($str) > MAX_FILE_SIZE) {
|
||||
throw new \Exception('Refusing to parse too big input');
|
||||
|
||||
if (strlen($str) > Configuration::getConfig('system', 'max_file_size')) {
|
||||
throw new \Exception('simple_html_dom: Refusing to parse too big input: ' . strlen($str));
|
||||
}
|
||||
|
||||
return $dom->load($str, $lowercase, $stripRN);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue