diff options
author | ArthurHoaro <arthur@hoa.ro> | 2018-03-13 18:02:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-13 18:02:49 +0100 |
commit | 4294bc7b98c8f45ceaac867cad3d5d35ee9eb096 (patch) | |
tree | d958d8d0cfab382250054cd610f0dd6f7880f67a /index.php | |
parent | 39ee93925b66b527c4386647001fadc898c52a2c (diff) | |
parent | 4ff3ed1c47365d5b28f70cb2921b0ac0075612c3 (diff) | |
download | Shaarli-4294bc7b98c8f45ceaac867cad3d5d35ee9eb096.tar.gz Shaarli-4294bc7b98c8f45ceaac867cad3d5d35ee9eb096.tar.zst Shaarli-4294bc7b98c8f45ceaac867cad3d5d35ee9eb096.zip |
Merge pull request #1096 from ArthurHoaro/feature/download-params
Make max download size and timeout configurable
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 | } |