note 60165 rejected from function.escapeshellarg by nlopess
| From: | nlopess@php.net | Date: | Wed, 28 Dec 2005 16:36:49 +0000 |
| Subject: | note 60165 rejected from function.escapeshellarg by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100871@lists.php.net to get a copy of this message | ||
Note Submitter: rich at dicksonlife dot com
----
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