]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
Make max download size and timeout configurable
[github/shaarli/Shaarli.git] / index.php
index bd34c0cd05aeab499d26fc8b650218544adf53b1..f7722433aaea8665e05e5c228c080b81aa7f1a81 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1376,7 +1376,12 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             if (empty($title) && strpos(get_url_scheme($url), 'http') !== false) {
                 // Short timeout to keep the application responsive
                 // The callback will fill $charset and $title with data from the downloaded page.
-                get_http_response($url, 25, 4194304, get_curl_download_callback($charset, $title));
+                get_http_response(
+                    $url,
+                    $conf->get('general.download_max_size', 4194304),
+                    $conf->get('general.download_timeout', 30),
+                    get_curl_download_callback($charset, $title)
+                );
                 if (! empty($title) && strtolower($charset) != 'utf-8') {
                     $title = mb_convert_encoding($title, 'utf-8', $charset);
                 }