aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-02-28 22:29:43 +0100
committerArthurHoaro <arthur@hoa.ro>2018-03-07 23:03:21 +0100
commit4ff3ed1c47365d5b28f70cb2921b0ac0075612c3 (patch)
tree5e3a1079211080d1af48696cc1f4815dd640f293 /index.php
parentb70436373b488ce9cd8b0dc287d058b5ca206347 (diff)
downloadShaarli-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.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.php b/index.php
index bd34c0cd..f7722433 100644
--- a/index.php
+++ b/index.php
@@ -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 }