note 75668 added to ref.exec
| From: | xmb at skilled dot ch | Date: | Mon, 11 Jun 2007 11:26:37 +0000 |
| Subject: | note 75668 added to ref.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127382@lists.php.net to get a copy of this message | ||
have -- fun, with shell_exec
i guess anyone waited for it, i didnt post it last time :/
function shell_exec_loop( $arr , $kind )
foreach( $arr as $var => $cont ) {
if ( $cont == "!" || preg_match( "/^!/" , $cont ) {
if ( $cont == "!" ) $cont = $var
$cont2 = prep_replace( "/!(.*)/" , "$1", $cont ) ;
$cont = eval( "echo \$$cont2" );
}
if ( $cont ) $arg = shellescapecmd( $cont ) ; ekse $arg = shellescapecmd( $var ) ;
if( $kind ) $str = "$str $var=$arg" ; else $str = "$str " shellescapecmd( $var
) ;
} ; return $str ;
}
function shell_exec( $vars, $cmd, $args ) {
$v = shell_exec_loop( $vars ,0 ); $a = shell_exec_args( $args ,1 );
exec( "$v " escapeshellcmd( $cmd ) " $a" );
}
----
Server IP: 194.153.94.10
Probable Submitter: 84.75.134.156
----
Manual Page -- http://www.php.net/manual/en/ref.exec.php
Edit -- https://master.php.net/note/edit/75668
Del: integrated -- https://master.php.net/note/delete/75668/integrated
Del: useless -- https://master.php.net/note/delete/75668/useless
Del: bad code -- https://master.php.net/note/delete/75668/bad+code
Del: spam -- https://master.php.net/note/delete/75668/spam
Del: non-english -- https://master.php.net/note/delete/75668/non-english
Del: in docs -- https://master.php.net/note/delete/75668/in+docs
Del: other reasons-- https://master.php.net/note/delete/75668
Reject -- https://master.php.net/note/reject/75668
Search -- https://master.php.net/manage/user-notes.php