Skip to content

Commit

Permalink
Merge pull request #60 from LibreSign/bugfix/prevent-pass-non-string-…
Browse files Browse the repository at this point in the history
…to-trim

Prevent pass null or false to trim function
  • Loading branch information
vitormattos authored Jun 18, 2023
2 parents 5b768e8 + aedd266 commit 50354da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/RunServerListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,11 @@ public function killZombies(): void
'grep "php -S ' . self::$host . '"|' .
'grep -v grep|' .
'sed -e "s/^[[:space:]]*//"|cut -d" " -f1';
$pids = trim(shell_exec($cmd));
$output = shell_exec($cmd);
if (!is_string($output)) {
return;
}
$pids = trim($output);
$pids = explode("\n", $pids);
foreach ($pids as $pid) {
if ($pid && (!$this->pid || $pid !== $this->pid)) {
Expand Down

0 comments on commit 50354da

Please sign in to comment.