note 49527 added to function.escapeshellcmd

From: Date: Mon, 31 Jan 2005 18:19:59 +0000
Subject: note 49527 added to function.escapeshellcmd
Groups: php.notes 
Request: Send a blank email to php-notes+get-84279@lists.php.net to get a copy of this message
This function does not work as shown in the php.net examples. If you put your encoded filename into double-quotes as they suggest, then it will break on certain characters in filenames, such as ampersand. For example if you have a filename called "foo & bar.jpg" and you use this function on it, your resulting filename when double-quoted will produce this and not be found: "foo \& bar.jpg" If you need to have a single argument where spaces are included then do not use this function with added double-quotes, use escapeshellarg() which encloses the whole string in single quotes. I do not understand which purpose this particular function is intended for. I can't see any use for it, unless you pass it through another function and convert spaces " " to "\ ", which would allow you to use the string directly on the command line. ---- Manual Page -- http://www.php.net/manual/en/function.escapeshellcmd.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49527 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49527&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49527&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49527&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49527&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49527&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49527&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84279) next »