Skip to content

Commit c1f92e0

Browse files
committed
Quote paths/filenames when doing the cleanup cron to handle spaces and characters
1 parent a0a63f3 commit c1f92e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

root/app/www/public/crons/cleanup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
if (filemtime($logfile) <= (time() - (86400 * LOG_AGE))) {
4646
echo date('c') . ' removing old logfile \'' . $logfile . '\''."\n";
47-
$shell->exec('rm ' . $logfile);
47+
$shell->exec('rm "' . $logfile . '"');
4848
}
4949
}
5050
closedir($dir);
@@ -61,7 +61,7 @@
6161
if (str_contains($backupFolder, '.zip')) {
6262
if (filemtime($backupFolder) <= (time() - (86400 * STARR_BACKUP_AGE))) {
6363
echo date('c') . ' removing old starr backup \'' . $backupFolder . '\''."\n";
64-
$shell->exec('rm ' . $backupFolder);
64+
$shell->exec('rm "' . $backupFolder . '"');
6565
}
6666
}
6767

@@ -71,7 +71,7 @@
7171

7272
if (filemtime($backupFolder) <= (time() - (86400 * BACKUP_AGE))) {
7373
echo date('c') . ' removing old backup \'' . $backupFolder . '\''."\n";
74-
$shell->exec('rm -r ' . $backupFolder);
74+
$shell->exec('rm -r "' . $backupFolder . '"');
7575
}
7676
}
7777
closedir($dir);

0 commit comments

Comments
 (0)