note 66430 added to function.escapeshellarg
| From: | php-general at lists dot php dot net | Date: | Mon, 22 May 2006 12:25:30 +0000 |
| Subject: | note 66430 added to function.escapeshellarg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111821@lists.php.net to get a copy of this message | ||
Most of the comments above have misunderstood this function. It does not need to escape characters
such as '$' and '`' - it uses the fact that the shell does not treat any
characters as special inside single quotes (except the single quote character itself). The correct
way to use this function is to call it on a variable that is intended to be passed to a command-line
program as a single argument to that program - you do not call it on command-line as a whole.
The person above who comments that this function behaves badly if given the empty string as input is
correct - this is a bug. It should indeed return two single quotes in this case.
----
Server IP: 85.116.0.130
Probable Submitter: 81.151.95.26
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.escapeshellarg.php
Edit -- http://master.php.net/note/edit/66430
Del: integrated -- http://master.php.net/note/delete/66430/integrated
Del: useless -- http://master.php.net/note/delete/66430/useless
Del: bad code -- http://master.php.net/note/delete/66430/bad+code
Del: spam -- http://master.php.net/note/delete/66430/spam
Del: non-english -- http://master.php.net/note/delete/66430/non-english
Del: in docs -- http://master.php.net/note/delete/66430/in+docs
Del: other reasons-- http://master.php.net/note/delete/66430
Reject -- http://master.php.net/note/reject/66430
Search -- http://master.php.net/manage/user-notes.php