File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -31,20 +31,19 @@ public function handle(): void
3131 {
3232 if (PHP_OS_FAMILY !== 'Linux ' ) {
3333 $ this ->error ('This command only works on Linux ' );
34-
3534 return ;
3635 }
3736
38- $ user = $ this ->argument ('user ' ) ?? '' ;
39- $ group = $ this ->argument ('group ' ) ?? $ user ;
37+ $ user = ( string ) ( $ this ->argument ('user ' ) ?? '' ) ;
38+ $ group = ( string ) ( $ this ->argument ('group ' ) ?? $ user) ;
4039
4140 if (empty ($ user ) || empty ($ group )) {
42- $ group = $ user = exec ('ps aux | egrep "(apache|httpd|nginx)" | grep -v "root" | head -n1 | cut -d\ -f1 ' );
41+ $ group = $ user = ( string ) exec ('ps aux | egrep "(apache|httpd|nginx)" | grep -v "root" | head -n1 | cut -d\ -f1 ' );
4342 }
4443
4544 $ jsonsPath = config ('telegram-git-notifier.data_file.storage_folder ' );
4645 if (is_string ($ jsonsPath ) && file_exists ($ jsonsPath )) {
47- shell_exec ("chown -R $ user: $ group $ jsonsPath" );
46+ shell_exec ("chown -R " . escapeshellarg ( $ user) . " : " . escapeshellarg ( $ group) . " " . escapeshellarg ( $ jsonsPath) );
4847 } else {
4948 $ this ->error ('The path to the jsons folder is not valid ' );
5049 }
You can’t perform that action at this time.
0 commit comments