mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Merge remote-tracking branch 'upstream/develop' into 1601-network-performance
This commit is contained in:
commit
32c7896c5d
6 changed files with 42 additions and 18 deletions
|
@ -792,15 +792,19 @@ function get_photo_info($url) {
|
|||
|
||||
$filesize = strlen($img_str);
|
||||
|
||||
$tempfile = tempnam(get_temppath(), "cache");
|
||||
if (function_exists("getimagesizefromstring"))
|
||||
$data = getimagesizefromstring($img_str);
|
||||
else {
|
||||
$tempfile = tempnam(get_temppath(), "cache");
|
||||
|
||||
$a = get_app();
|
||||
$stamp1 = microtime(true);
|
||||
file_put_contents($tempfile, $img_str);
|
||||
$a->save_timestamp($stamp1, "file");
|
||||
$a = get_app();
|
||||
$stamp1 = microtime(true);
|
||||
file_put_contents($tempfile, $img_str);
|
||||
$a->save_timestamp($stamp1, "file");
|
||||
|
||||
$data = getimagesize($tempfile);
|
||||
unlink($tempfile);
|
||||
$data = getimagesize($tempfile);
|
||||
unlink($tempfile);
|
||||
}
|
||||
|
||||
if ($data)
|
||||
$data["size"] = $filesize;
|
||||
|
|
|
@ -1246,6 +1246,9 @@ function original_url($url, $depth=1, $fetchbody = false) {
|
|||
|
||||
$a->save_timestamp($stamp1, "network");
|
||||
|
||||
if ($http_code == 0)
|
||||
return($url);
|
||||
|
||||
if ((($curl_info['http_code'] == "301") OR ($curl_info['http_code'] == "302"))
|
||||
AND (($curl_info['redirect_url'] != "") OR ($curl_info['location'] != ""))) {
|
||||
if ($curl_info['redirect_url'] != "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue