mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
make sure cache dir is a directory before running exec command
This commit is contained in:
parent
384d1f58b5
commit
0be0ffdbe5
|
@ -31,6 +31,13 @@ if(!checkFormKey('clearcache')) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("invalid_request_token"));
|
UI::exitError(getMLText("admin_tools"),getMLText("invalid_request_token"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure the cacheDir exists and isn't manipulated for executing
|
||||||
|
* commands when system() is being called.
|
||||||
|
*/
|
||||||
|
if(!is_dir($settings->_cacheDir)) {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("error_cleared_cache"));
|
||||||
|
}
|
||||||
|
|
||||||
if(!empty($_POST['preview'])) {
|
if(!empty($_POST['preview'])) {
|
||||||
$cmd = 'rm -rf '.$settings->_cacheDir.'/[1-9]*';
|
$cmd = 'rm -rf '.$settings->_cacheDir.'/[1-9]*';
|
||||||
$ret = null;
|
$ret = null;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user