From: danishzahoor at gmail dot com
Operating system: Linux
PHP version: 4.4.6
PHP Bug Type: Program Execution
Bug description: String concat operator and function param
Description:
------------
Anything string that comes after concat operator will be concaticated in
string param of include_once function.
Reproduce code:
---------------
<?php
print "Including file from lib first<BR>";
echo "result = " . include_once("lib/file.php") . "<BR>";
test1();
function test1()
{
print "Including file from lib inside function.<BR>";
print "result = " . include_once("lib/file.php") . "<BR>";
}
?>
Actual result:
--------------
PHP 4
=====
Including file from lib first
Warning: main(lib/file.php
): failed to open stream: No such file or directory in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 4
Warning: main(): Failed opening 'lib/file.php<BR>' for inclusion
(include_path='.:/usr/local/php/lib/php') in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 4
result = Including file from lib inside function.
Warning: test1(lib/file.php
): failed to open stream: No such file or directory in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 10
Warning: test1(): Failed opening 'lib/file.php<BR>' for inclusion
(include_path='.:/usr/local/php/lib/php') in
/var/www/www.mobiletest.com/htdocs/html/php.samnan/php5_tests/test_include_once.php
on line 10
result =
PHP 5
=====
Including file from lib first
Warning: include_once(lib/file.php<BR>) [function.include-once]: failed to
open stream: No such file or directory in
/var/webuser/php.samnan/temp/test_include_once.php on line 4
Warning: include_once() [function.include]: Failed opening
'lib/file.php<BR>' for inclusion (include_path='./:/usr/local/php/lib/php')
in /var/webuser/php.samnan/temp/test_include_once.php on line 4
result = Including file from lib inside function.
Warning: include_once(lib/file.php<BR>) [function.include-once]: failed to
open stream: No such file or directory in
/var/webuser/php.samnan/temp/test_include_once.php on line 10
Warning: include_once() [function.include]: Failed opening
'lib/file.php<BR>' for inclusion (include_path='./:/usr/local/php/lib/php')
in /var/webuser/php.samnan/temp/test_include_once.php on line 10
result =
--
Edit bug report at http://bugs.php.net/?id=41114&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41114&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41114&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41114&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41114&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41114&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41114&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41114&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41114&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41114&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41114&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41114&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41114&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41114&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41114&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41114&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41114&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41114&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41114&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41114&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41114&r=mysqlcfg