mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
firewall: make sure downloaded file is there
This commit is contained in:
parent
da3b10c664
commit
9d250cd1f5
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user