The backtick (`) operator is deprecated, use shell_exec() instead

This commit is contained in:
the-djmaze 2026-10-22 23:02:00 +02:00
parent c9f7d27551
commit e1e94c815d
4 changed files with 9 additions and 9 deletions

View file

@ -9,7 +9,7 @@ if (isset($options['plugins'])) {
require(ROOT_DIR . '/build/plugins.php'); require(ROOT_DIR . '/build/plugins.php');
} }
$gulp = trim(`which gulp`); $gulp = trim(shell_exec('which gulp'));
if (!$gulp) { if (!$gulp) {
exit('gulp not installed, run as root: npm install --global gulp-cli'); exit('gulp not installed, run as root: npm install --global gulp-cli');
} }
@ -34,7 +34,7 @@ $options['aur'] = isset($options['aur']);
// Docker build // Docker build
$options['docker'] = isset($options['docker']); $options['docker'] = isset($options['docker']);
if ($options['docker'] && !($docker = trim(`which docker`))) { if ($options['docker'] && !($docker = trim(shell_exec('which docker')))) {
exit('docker not found'); exit('docker not found');
} }
if ($options['docker'] && $options['aur']) { if ($options['docker'] && $options['aur']) {
@ -60,7 +60,7 @@ if (!isset($options['skip-gulp'])) {
$cmddir = escapeshellcmd(ROOT_DIR) . '/snappymail/v/0.0.0/static'; $cmddir = escapeshellcmd(ROOT_DIR) . '/snappymail/v/0.0.0/static';
if ($gzip = trim(`which gzip`)) { if ($gzip = trim(shell_exec('which gzip'))) {
echo "\x1b[33;1m === Gzip *.js and *.css === \x1b[0m\n"; echo "\x1b[33;1m === Gzip *.js and *.css === \x1b[0m\n";
passthru("{$gzip} -k --best {$cmddir}/js/*.js"); passthru("{$gzip} -k --best {$cmddir}/js/*.js");
passthru("{$gzip} -k --best {$cmddir}/js/min/*.js"); passthru("{$gzip} -k --best {$cmddir}/js/min/*.js");
@ -70,7 +70,7 @@ if (!isset($options['skip-gulp'])) {
unlink(ROOT_DIR . '/snappymail/v/0.0.0/static/js/min/boot.min.js.gz'); unlink(ROOT_DIR . '/snappymail/v/0.0.0/static/js/min/boot.min.js.gz');
} }
if ($brotli = trim(`which brotli`)) { if ($brotli = trim(shell_exec('which brotli'))) {
echo "\x1b[33;1m === Brotli *.js and *.css === \x1b[0m\n"; echo "\x1b[33;1m === Brotli *.js and *.css === \x1b[0m\n";
passthru("{$brotli} -k --best {$cmddir}/js/*.js"); passthru("{$brotli} -k --best {$cmddir}/js/*.js");
passthru("{$brotli} -k --best {$cmddir}/js/min/*.js"); passthru("{$brotli} -k --best {$cmddir}/js/min/*.js");
@ -188,7 +188,7 @@ file_put_contents("{$destPath}core.json", '{
// Arch User Repository // Arch User Repository
if ($options['aur']) { if ($options['aur']) {
// extension_loaded('blake2') // extension_loaded('blake2')
if (!function_exists('b2sum') && $b2sum = trim(`which b2sum`)) { if (!function_exists('b2sum') && $b2sum = trim(shell_exec('which b2sum'))) {
function b2sum($file) { function b2sum($file) {
$file = escapeshellarg($file); $file = escapeshellarg($file);
exec("b2sum --binary {$file} 2>&1", $output, $exitcode); exec("b2sum --binary {$file} 2>&1", $output, $exitcode);

View file

@ -434,7 +434,7 @@ abstract class Base
public function agent() public function agent()
{ {
// $home = \escapeshellarg($this->options['homedir']); // $home = \escapeshellarg($this->options['homedir']);
// echo `gpg-agent --daemon --homedir $home 2>&1`; // echo \shell_exec('gpg-agent --daemon --homedir $home 2>&1');
} }
protected function getPassphrase($key) protected function getPassphrase($key)
@ -487,7 +487,7 @@ abstract class Base
protected static function findBinary($name) : ?string protected static function findBinary($name) : ?string
{ {
$binary = \function_exists('shell_exec') ? \trim((string) `which $name`) : ''; $binary = \function_exists('shell_exec') ? \trim((string) \shell_exec('which $name')) : '';
if ($binary && \RainLoop\Utils::inOpenBasedir($binary) && \is_executable($binary)) { if ($binary && \RainLoop\Utils::inOpenBasedir($binary) && \is_executable($binary)) {
return $binary; return $binary;
} }

View file

@ -43,7 +43,7 @@ class SMIME extends Base
// How to use gpgme-json ? // How to use gpgme-json ?
$this->binary = static::findBinary('gpgsm'); $this->binary = static::findBinary('gpgsm');
$info = \preg_replace('/\R +/', ' ', `$this->binary --version`); $info = \preg_replace('/\R +/', ' ', \shell_exec("{$this->binary} --version"));
if (\preg_match('/gpgsm.+([0-9]+\\.[0-9]+\\.[0-9]+)/', $info, $match)) { if (\preg_match('/gpgsm.+([0-9]+\\.[0-9]+\\.[0-9]+)/', $info, $match)) {
$this->version = $match[1]; $this->version = $match[1];
} }

View file

@ -180,7 +180,7 @@ class OpenSSL
} }
$input = $tmp; $input = $tmp;
} }
`openssl asn1parse -in $input->filename()` \shell_exec('openssl asn1parse -in $input->filename()');
} }
*/ */
public function decrypt(/*string|Temporary*/ $input) : ?string public function decrypt(/*string|Temporary*/ $input) : ?string