note 127603 added to function.escapeshellarg
| From: | TonyC at main dot php dot net | Date: | Thu, 08 Sep 2022 21:59:03 +0000 |
| Subject: | note 127603 added to function.escapeshellarg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219546@lists.php.net to get a copy of this message | ||
While using this function to pass filenames to the command line I noticed shell_exec() was failing.
Upon further investigation it appears escapeshellarg() removes double spaces from file names.
For example:
$filename = "my super file.txt"; // notice the double space after "my"
echo escapeshellarg($filename);
Produces:
'my super file.txt'
(second space was removed)
----
Server IP: 45.112.84.4
Probable Submitter: 185.85.3.173 (proxied: 2607:fb90:db03:8b12:2f80:1a9d:284d:ac6f)
----
Manual Page -- https://php.net/manual/en/function.escapeshellarg.php
Edit -- https://main.php.net/note/edit/127603
Del: integrated -- https://main.php.net/note/delete/127603/integrated
Del: useless -- https://main.php.net/note/delete/127603/useless
Del: bad code -- https://main.php.net/note/delete/127603/bad+code
Del: spam -- https://main.php.net/note/delete/127603/spam
Del: non-english -- https://main.php.net/note/delete/127603/non-english
Del: in docs -- https://main.php.net/note/delete/127603/in+docs
Del: other reasons-- https://main.php.net/note/delete/127603
Reject -- https://main.php.net/note/reject/127603
Search -- https://main.php.net/manage/user-notes.php