Skip to content
This repository was archived by the owner on Oct 25, 2022. It is now read-only.

Commit 3d9a098

Browse files
authored
Changed execute() function.
Wrong validation on the `$run_as_user` strlen Wrong su command -u option
1 parent bac0228 commit 3d9a098

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/JasperPHP/JasperPHP.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ public function execute($run_as_user = false)
166166
if( $this->background && !$this->windows )
167167
$this->the_command .= " &";
168168

169-
if( $run_as_user !== false && strlen($run_as_user > 0) && !$this->windows )
170-
$this->the_command = "su -u " . $run_as_user . " -c \"" . $this->the_command . "\"";
169+
if( $run_as_user !== false && strlen($run_as_user) > 0 && !$this->windows )
170+
$this->the_command = "su -c \"{$this->the_command}\" {$run_as_user}";
171171

172172
$output = array();
173173
$return_var = 0;

0 commit comments

Comments
 (0)