aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-03-13 18:02:49 +0100
committerGitHub <noreply@github.com>2018-03-13 18:02:49 +0100
commit4294bc7b98c8f45ceaac867cad3d5d35ee9eb096 (patch)
treed958d8d0cfab382250054cd610f0dd6f7880f67a /index.php
parent39ee93925b66b527c4386647001fadc898c52a2c (diff)
parent4ff3ed1c47365d5b28f70cb2921b0ac0075612c3 (diff)
downloadShaarli-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.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/index.php b/index.php
index 3b8b52a7..f7f87d95 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 }