#36060 [Opn->Fbk]: `--' end arguments terminator incorrectly sent to script (CGI only)
ID: 36060
Updated by: tony2001@php.net
Reported By: support-forums4 at farmdev dot com
-Status: Open
+Status: Feedback
Bug Type: CGI related
Operating System: FreeBSD
PHP Version: 5.1.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-01-17 22:53:30] support-forums4 at farmdev dot com
Description:
------------
see test script, run it like ...
$ php -f test_end_arg.php -- -h -f
PHP should execute the script as the equivalent of `test_end_arg.php -h
-f`. This works in the cli version of php but not the cgi version (from
command line). Sorry I couldn't test on more versions.
Cli version I tested with (PASSED) was :
====================
PHP Version => 5.0.4
System => Linux dev 2.4.18-1-686 #1 Wed Apr 14 18:20:10 UTC 2004 i686
Build Date => May 12 2005 14:12:56
Configure Command => './configure' '--prefix=/vol2/php5'
'--with-apxs=/vol2/php5/bin/apxs'
'-with-config-file-scan-dir=/vol2/php5/lib/php' '--enable-shared'
'--with-zlib=shared' '--with-curl=shared,/vol2/php5'
'--with-mcrypt=shared,/vol2/php5' '--with-mhash=shared,/vol2/php5'
'--with-openssl=shared' '--with-gettext=shared' '--with-gd=shared'
'--enable-wddx=shared' '--with-jpg-dir=/usr' '--with-png-dir=/usr'
'--enable-dba=shared' '--with-mysql=shared,/usr/local/mysql'
'--with-pgsql=shared,/usr/local/pgsql' '--enable-soap=shared'
'--enable-sysvshm=shared' '--enable-sysvmsg=shared'
'--enable-sysvsem=shared' '--with-libxml-dir=/vol2/php5'
Server API => Command Line Interface
====================================
CGI version I tested with (FAILED) was :
====================================
PHP Version 5.0.5
System FreeBSD dev2.leapfrogonline.com 4.11-RELEASE FreeBSD
4.11-RELEASE #0: Fri Ja i386
Build Date Sep 22 2005 16:22:00
Configure Command './configure' '--enable-versioning'
'--enable-memory-limit' '--with-layout=GNU'
'--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
'--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-spl'
'--with-regex=php' '--disable-cli' '--enable-force-cgi-redirect'
'--enable-discard-path' '--enable-fastcgi' '--prefix=/usr/local'
'i386-portbld-freebsd4.11'
Server API CGI/FastCGI
====================================
Reproduce code:
---------------
test_end_arg.php:
<?php
print_r($_SERVER['argv']);
assert( !in_array('--',$_SERVER['argv']));
?>
Expected result:
----------------
// see description about how to run the script
Array
(
[0] => test_end_arg.php
[1] => -h
[2] => -f
)
Actual result:
--------------
PHP Warning: assert() [<a href='function.assert'>function.assert</a>]:
Assertion failed in /home/kumar/tmp/test_end_arg.php on line 3
Array
(
[0] => test_end_arg.php
[1] => --
[2] => -h
[3] => -f
)
<br />
<b>Warning</b>: assert() [<a
href='function.assert'>function.assert</a>]: Assertion failed in
<b>/home/kumar/tmp/test_end_arg.php</b> on line <b>3</b><br />
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36060&edit=1
Thread (5 messages)