mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Merge with 3.7
This commit is contained in:
@@ -900,4 +900,18 @@ abstract class task_abstract
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape a shell command.
|
||||
*
|
||||
* As this function is buggy under windows, this method check the
|
||||
* environment
|
||||
*
|
||||
* @param string $command
|
||||
* @return string
|
||||
*/
|
||||
protected static function escapeShellCmd($command)
|
||||
{
|
||||
return defined('PHP_WINDOWS_VERSION_BUILD') ? escapeshellarg($command) : escapeshellcmd($command);
|
||||
}
|
||||
}
|
||||
|
@@ -473,18 +473,18 @@ class task_period_cindexer extends task_abstract
|
||||
|
||||
$pipes = array();
|
||||
|
||||
$logcmd = $cmd;
|
||||
$logcmd = self::escapeShellCmd($cmd);
|
||||
foreach ($args_nopwd as $arg) {
|
||||
$logcmd .= ' ' . escapeshellarg($arg);
|
||||
}
|
||||
|
||||
$this->log(sprintf('cmd=\'%s\'', escapeshellcmd($logcmd)));
|
||||
$this->log(sprintf('cmd=\'%s\'', self::escapeShellCmd($logcmd)));
|
||||
|
||||
$execmd = $cmd;
|
||||
$execmd = self::escapeShellCmd($cmd);
|
||||
foreach ($args as $arg) {
|
||||
$execmd .= ' ' . escapeshellarg($arg);
|
||||
}
|
||||
$process = proc_open(escapeshellcmd($execmd), $descriptors, $pipes, $this->binpath, null, array('bypass_shell' => true));
|
||||
$process = proc_open($execmd, $descriptors, $pipes, $this->binpath, null, array('bypass_shell' => true));
|
||||
|
||||
$pid = NULL;
|
||||
if (is_resource($process)) {
|
||||
|
Reference in New Issue
Block a user