X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fremote_url.inc;h=0e53dbf466eab1cc32445cd9ca935f1d8c919504;hb=11109ad9f0e6af3f59d72731a95e473e72fb308b;hp=186b4f97660aeaabb6f9c737b6dacede1ad521e9;hpb=4298d725b65da75bf2995b106333f4b938080b9b;p=fa-stable.git diff --git a/includes/remote_url.inc b/includes/remote_url.inc index 186b4f97..0e53dbf4 100644 --- a/includes/remote_url.inc +++ b/includes/remote_url.inc @@ -19,6 +19,9 @@ function url_get_contents($url, $timeout=10) // get the host name and url path $parsedUrl = parse_url($url); + if (@$parsedUrl['scheme'] == 'file') + return file_get_contents($parsedUrl['path']); + $host = $parsedUrl['host']; if (isset($parsedUrl['path'])) { @@ -85,6 +88,8 @@ function url_get_contents($url, $timeout=10) function url_copy($from, $to, $timeout=10) { $f = fopen($to, 'wb'); - fwrite($f, url_get_contents($from, $timeout)); + if (!$f || !fwrite($f, url_get_contents($from, $timeout))) + return false; fclose($f); + return true; }