is_command() 대체

This commit is contained in:
conory 2019-10-09 23:28:23 +09:00
parent 9a78f0f0a0
commit 77122a32b2
6 changed files with 18 additions and 25 deletions

View file

@ -691,23 +691,4 @@ function is_empty_html_content($str)
$str = strip_tags($str, '<img><audio><video><iframe><object><embed>');
$str = utf8_trim(utf8_clean(html_entity_decode($str, ENT_QUOTES, 'UTF-8')));
return $str === '';
}
/**
* Check if a external program can be executed.
*
* @param string $command
* @return bool
*/
function is_command($command)
{
if ($command && function_exists('exec'))
{
@exec('ls ' . escapeshellarg($command), $output, $return_var);
return $return_var === 0;
}
else
{
return false;
}
}