note 33280 added to function.popen

From: Date: Fri, 20 Jun 2003 18:27:51 +0000
Subject: note 33280 added to function.popen
Groups: php.notes 
Request: Send a blank email to php-notes+get-50765@lists.php.net to get a copy of this message
This one works However, I don't know how secure it is function filterThroughCmd($input, $commandLine) { // replace all doublequotes $input = str_replace ("\"", "\\\"", $input); $pipe = popen("echo \"$input\"|$commandLine" , 'r'); if (!$pipe) { print "pipe failed."; return ""; } $output = ''; while(!feof($pipe)) { $output .= fread($pipe, 1024); } pclose($pipe); return $output; } ---- Manual Page -- http://www.php.net/manual/en/function.popen.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33280 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33280&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33280&report=yes

« previous php.notes (#50765) next »