Bug #14982: passthru() fails if more than one command line argument is quoted
| From: | peter dot linstrom at nist dot gov | Date: | Thu, 10 Jan 2002 23:20:00 +0000 |
| Subject: | Bug #14982: passthru() fails if more than one command line argument is quoted | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-76550@lists.php.net to get a copy of this message | ||
From: peter.linstrom@nist.gov
Operating system: Windows NT 4.0/ Windows 2000
PHP version: 4.1.1
PHP Bug Type: Performance problem
Bug description: passthru() fails if more than one command line argument is quoted
Problem:
When the command line passed to passthru contains more than
one argument that is quoted, the command line is not run.
For example:
passthru("\"C:\\Some dir\\prog.exe\" arg"); -- works
passthru("\"C:\\Some dir\\prog.exe\" \"new arg\""); --fails
Systems tested:
Windows NT 4.0 and Windows 2000
Apache 1.3.22 with php4apache.dll
PHP versions 4.1 and 4.1.1 (problem not present w/ 4.06)
PHP and Apache are the distributed Windows binaries
safe_mode is off
Example script:
<html>
<head>
<title>PHP Test Script</title>
</head>
<body>
<h1>PHP Test Script</h1>
<?php
function write_example($command)
{
// Write a header.
echo "\n<h2>Command: ", htmlspecialchars($command),
"</h2>\n\n<pre>\n";
// Run the command.
passthru($command);
// Finish up the section.
echo "\n</pre>\n";
// Done, return.
return false;
}
write_example("test.bat");
write_example("\"test.bat\"");
write_example("\"test.bat\" arg");
write_example("\"test.bat\" \"arg\"");
?>
</body>
</html>
Contents of "test.bat" (goes in same dir as script above):
@echo Batch file run OK
--
Edit bug report at: http://bugs.php.net/?id=14982&edit=1