X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FPhoto.php;h=d87bce478704fccb6489097269e2e83163a4fd5f;hb=0deea97cf296481d792429ae9d4042c66887230d;hp=91fce55a86f868c4959291618fa4b8af77c4bba6;hpb=1cdcb9fc2e9abc97167a6b004d773172e4166eb7;p=friendica.git diff --git a/include/Photo.php b/include/Photo.php index 91fce55a86..d87bce4787 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -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; }