Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserCountry/GeoIPAutoUpdater.php')
-rwxr-xr-xplugins/UserCountry/GeoIPAutoUpdater.php6
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) {