use DIRECTORY_SEPARATOR when building path to cache dir

This commit is contained in:
Uwe Steinmann 2023-09-14 12:10:12 +02:00
parent 4d3fa42716
commit c2a4c76f3f

View File

@ -30,22 +30,22 @@ class SeedDMS_Controller_ClearCache extends SeedDMS_Controller_Common {
$ret = ''; $ret = '';
if(!empty($post['previewpng'])) { if(!empty($post['previewpng'])) {
$cmd = 'rm -rf '.$settings->_cacheDir.'/png/[1-9]*'; $cmd = 'rm -rf '.addDirSep($settings->_cacheDir).'png'.DIRECTORY_SEPARATOR.'[1-9]*';
system($cmd, $ret); system($cmd, $ret);
} }
if(!empty($post['previewpdf'])) { if(!empty($post['previewpdf'])) {
$cmd = 'rm -rf '.$settings->_cacheDir.'/pdf/[1-9]*'; $cmd = 'rm -rf '.addDirSep($settings->_cacheDir).'pdf'.DIRECTORY_SEPARATOR.'[1-9]*';
system($cmd, $ret); system($cmd, $ret);
} }
if(!empty($post['previewtxt'])) { if(!empty($post['previewtxt'])) {
$cmd = 'rm -rf '.$settings->_cacheDir.'/txt/[1-9]*'; $cmd = 'rm -rf '.addDirSep($settings->_cacheDir).'txt'.DIRECTORY_SEPARATOR.'[1-9]*';
system($cmd, $ret); system($cmd, $ret);
} }
if(!empty($post['js'])) { if(!empty($post['js'])) {
$cmd = 'rm -rf '.$settings->_cacheDir.'/js/*'; $cmd = 'rm -rf '.addDirSep($settings->_cacheDir).'js'.DIRECTORY_SEPARATOR.'*';
system($cmd, $ret); system($cmd, $ret);
} }