#14982 [Opn->Csd]: passthru() fails if more than one command line argument is quoted
| From: | iliaa@php.net | Date: | Fri, 30 Aug 2002 17:51:01 +0000 |
| Subject: | #14982 [Opn->Csd]: passthru() fails if more than one command line argument is quoted | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18274@lists.php.net to get a copy of this message | ||
ID: 14982
Updated by: iliaa@php.net
Reported By: peter.linstrom@nist.gov
-Status: Open
+Status: Closed
Bug Type: Performance problem
Operating System: Windows NT 4.0/ Windows 2000
PHP Version: 4.1.1
New Comment:
This bug has been fixed in CVS.
In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-01-10 18:19:59] peter.linstrom@nist.gov
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 this bug report at http://bugs.php.net/?id=14982&edit=1