diff --git a/lib/functions/filedir/function.safe_exec.php b/lib/functions/filedir/function.safe_exec.php index 28b9c6c1..e72fdb00 100644 --- a/lib/functions/filedir/function.safe_exec.php +++ b/lib/functions/filedir/function.safe_exec.php @@ -82,7 +82,7 @@ function safe_exec($exec_string, &$return_value = false) $ok = false; foreach($allowed_commands as $allowed_command) { - if(strpos($exec_string, $allowed_command) == 0 + if(strpos($exec_string, $allowed_command) === 0 && (strlen($exec_string) === ($allowed_command_pos = strlen($allowed_command)) || substr($exec_string, $allowed_command_pos, 1) === ' ')) { $ok = true;