diff options
Diffstat (limited to 'plugins/UserCountry/GeoIPAutoUpdater.php')
-rwxr-xr-x | plugins/UserCountry/GeoIPAutoUpdater.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/UserCountry/GeoIPAutoUpdater.php b/plugins/UserCountry/GeoIPAutoUpdater.php index 77636afdd1..2c44ebb66d 100755 --- a/plugins/UserCountry/GeoIPAutoUpdater.php +++ b/plugins/UserCountry/GeoIPAutoUpdater.php @@ -268,7 +268,11 @@ class GeoIPAutoUpdater extends Task } $tempFile = GeoIp::getPathForGeoIpDatabase($tempFilename); - rename($tempFile, $oldDbFile); + if (@rename($tempFile, $oldDbFile) !== true) { + //In case the $tempfile cannot be renamed, we copy the file. + copy($tempFile, $oldDbFile); + unlink($tempFile); + } // delete original archive if ($unlink) { |