#14853 [Opn->Bgs]: escapeshellarg should return '' for empty argument list

From: Date: Fri, 07 Feb 2003 03:13:00 +0000
Subject: #14853 [Opn->Bgs]: escapeshellarg should return '' for empty argument list
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-32352@lists.php.net to get a copy of this message
ID: 14853 Updated by: iliaa@php.net Reported By: jbriggs@esoft.com -Status: Open +Status: Bogus Bug Type: Feature/Change Request Operating System: Linux PHP Version: 4.1.0 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. This seems like a rather unexpected behaviour to me and if the feature you request is added it'll likely break many scripts. Do your own input validation. Previous Comments: ------------------------------------------------------------------------ [2002-01-04 13:05:56] jbriggs@esoft.com If I build a command line like this: $cmd = "ls "; $cmd .= escapeshellarg($file); system($cmd); It works fine if $file contains data. But if $file is empty, $cmd is "ls " instead of "ls ''". The code would be easier to write if escapeshellarg always returned the two single quotes, even if its argument was blank. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=14853&edit=1

« previous php.bugs (#32352) next »