1
0
Fork 0

Bugfix: Sometimes uploaded pictures weren't posted correctly to other networks

This commit is contained in:
Michael Vogel 2016-05-29 10:59:06 +02:00
commit 5580c0d708
2 changed files with 13 additions and 4 deletions

View file

@ -823,9 +823,12 @@ function get_photo_info($url) {
$data = Cache::get($url);
if (is_null($data)) {
$img_str = fetch_url($url, true, $redirects, 4);
// Unserialise to be able to check in the next step if the cached data is alright.
if (!is_null($data))
$data = unserialize($data);
if (is_null($data) OR !$data) {
$img_str = fetch_url($url, true, $redirects, 4);
$filesize = strlen($img_str);
if (function_exists("getimagesizefromstring"))
@ -846,8 +849,7 @@ function get_photo_info($url) {
$data["size"] = $filesize;
Cache::set($url, serialize($data));
} else
$data = unserialize($data);
}
return $data;
}