Skip to content

Commit 2210bde

Browse files
committed
remove index.php from files array before moving any files
1 parent 26fc8cd commit 2210bde

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

server/lib/classes/cron.d/150-awstats.inc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ public function onRunJob() {
148148
mkdir($statsdirold);
149149
}
150150
$files = scandir($statsdir);
151+
152+
if (($key = array_search('index.php', $files)) !== false) {
153+
unset($files[$key]);
154+
}
155+
151156
foreach ($files as $file) {
152157
if (substr($file, 0, 1) != "." && !is_dir("$statsdir"."/"."$file") && substr($file, 0, 1) != "w" && substr($file, 0, 1) != "i") $app->system->move("$statsdir"."/"."$file", "$statsdirold"."$file");
153158
}

server/lib/classes/cron.d/150-goaccess.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ public function onRunJob() {
170170
}
171171

172172
$files = scandir($statsdir);
173+
if (($key = array_search('index.php', $files)) !== false) {
174+
unset($files[$key]);
175+
}
173176

174177
foreach ($files as $file) {
175178
if (substr($file, 0, 1) != "." && !is_dir("$statsdir"."/"."$file") && substr($file, 0, 1) != "w" && substr($file, 0, 1) != "i") $app->system->move("$statsdir"."/"."$file", "$statsdirold"."$file");

0 commit comments

Comments
 (0)