]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #977 from ArthurHoaro/feature/dl-filter
authorArthurHoaro <arthur@hoa.ro>
Tue, 23 Jan 2018 17:41:38 +0000 (18:41 +0100)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2018 17:41:38 +0000 (18:41 +0100)
Extract the title/charset during page download, and check content type

1  2 
application/HttpUtils.php
application/LinkUtils.php
index.php
tests/LinkUtilsTest.php

index c9371b55c5cc6ddacd9a888984889a466075b63a,2edf5ce2df74bcb39fd5a1ce15c401302ff666c1..83a4c5e28699eff2472e4b7c132cef1e8bc53e8b
@@@ -75,8 -77,12 +77,12 @@@ function get_http_response($url, $timeo
      curl_setopt($ch, CURLOPT_TIMEOUT,           $timeout);
      curl_setopt($ch, CURLOPT_USERAGENT,         $userAgent);
  
+     if (is_callable($curlWriteFunction)) {
+         curl_setopt($ch, CURLOPT_WRITEFUNCTION, $curlWriteFunction);
+     }
      // Max download size management
 -    curl_setopt($ch, CURLOPT_BUFFERSIZE,        1024);
 +    curl_setopt($ch, CURLOPT_BUFFERSIZE,        1024*16);
      curl_setopt($ch, CURLOPT_NOPROGRESS,        false);
      curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
          function($arg0, $arg1, $arg2, $arg3, $arg4 = 0) use ($maxBytes)
Simple merge
diff --cc index.php
Simple merge
Simple merge