firewall: make sure downloaded file is there

This commit is contained in:
Franco Fichtner 2016-08-05 09:37:54 +02:00
parent da3b10c664
commit 9d250cd1f5

View File

@ -128,6 +128,16 @@ function download_file($url, $destination, $verify_ssl = false, $connect_timeout
fclose($fp);
curl_close($ch);
/*
* Crash reports indicated that this can fail on bad
* lines, causing the download to be "ok", but not
* actually writing the target file. Make it a hard
* failure...
*/
if (!file_exists($destination)) {
return false;
}
return ($http_code == 200);
}