note 60165 added to function.escapeshellarg
| From: | rich at dicksonlife dot com | Date: | Wed, 28 Dec 2005 15:06:27 +0000 |
| Subject: | note 60165 added to function.escapeshellarg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100856@lists.php.net to get a copy of this message | ||
I would like a version of this that allows wildcard characters. I would write one myself but I want
to be careful of "gotchas" and I'm not sure that it is even actually possible to
allow wildcards and still be secure. So I'll post here and see who has any comments.
How would a function be that escaped (put a \ before) all special characters except for periods and
asterisks (. and *)?
Would it be worthwhile maybe having a function which accepted an optional second parameter which
could be
ACCEPT_WILDCARDS
ACCEPT_REDIRECTS
ACCEPT_WHITESPACE
ACCEPT_VARSUBS
others?
Though redirects and whitespace are questionable for what is supposed to be a single shell argument
and variable substitutions would be somewhat risky I think. It's not something I have to deal
with a lot which is why I'm putting a call out to those with more experience.
???
Rich
----
Manual Page -- http://www.php.net/manual/en/function.escapeshellarg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60165
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60165&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60165&report=yes
Search -- http://master.php.net/manage/user-notes.php