diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-02-28 22:29:43 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2018-03-07 23:03:21 +0100 |
commit | 4ff3ed1c47365d5b28f70cb2921b0ac0075612c3 (patch) | |
tree | 5e3a1079211080d1af48696cc1f4815dd640f293 /index.php | |
parent | b70436373b488ce9cd8b0dc287d058b5ca206347 (diff) | |
download | Shaarli-4ff3ed1c47365d5b28f70cb2921b0ac0075612c3.tar.gz Shaarli-4ff3ed1c47365d5b28f70cb2921b0ac0075612c3.tar.zst Shaarli-4ff3ed1c47365d5b28f70cb2921b0ac0075612c3.zip |
Make max download size and timeout configurable
Fixes #1061
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -1376,7 +1376,12 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager, | |||
1376 | if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { | 1376 | if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) { |
1377 | // Short timeout to keep the application responsive | 1377 | // Short timeout to keep the application responsive |
1378 | // The callback will fill $charset and $title with data from the downloaded page. | 1378 | // The callback will fill $charset and $title with data from the downloaded page. |
1379 | get_http_response($url, 25, 4194304, get_curl_download_callback($charset, $title)); | 1379 | get_http_response( |
1380 | $url, | ||
1381 | $conf->get('general.download_max_size', 4194304), | ||
1382 | $conf->get('general.download_timeout', 30), | ||
1383 | get_curl_download_callback($charset, $title) | ||
1384 | ); | ||
1380 | if (! empty($title) && strtolower($charset) != 'utf-8') { | 1385 | if (! empty($title) && strtolower($charset) != 'utf-8') { |
1381 | $title = mb_convert_encoding($title, 'utf-8', $charset); | 1386 | $title = mb_convert_encoding($title, 'utf-8', $charset); |
1382 | } | 1387 | } |