Bug #55088 [Com]: $GLOBALS[_REQUEST][something] not set variable on auto_prepend_file

2011-07-06 Thread m dot rondini at tigersecurity dot it
Edit report at https://bugs.php.net/bug.php?id=55088edit=1

 ID: 55088
 Comment by: m dot rondini at tigersecurity dot it
 Reported by:m dot rondini at tigersecurity dot it
 Summary:$GLOBALS[_REQUEST][something] not set variable
 on auto_prepend_file
 Status: Wont fix
 Type:   Bug
 Package:*General Issues
 Operating System:   Linux
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

why, if i use require('test1.php'); in test2.php, work it fine?
After prepend require, the return is requestbr /get, how i would see. 
But, 
using auto_prepend_file, something wrong. Is It a bug or other?


Previous Comments:

[2011-07-06 05:06:40] johan...@php.net

Super-Globals ($_GET / $_REQUEST / $_SESSION / ...) are optimized that they are 
only provided if the parser detects them being used. If you write 
$GLOBALS[_REQUEST] only this won't be detected.

You can fix the issue by writing

$_REQUEST[test] = request;
$_GET[test1] = get;

or by setting auto_globals_jit=0 in php.ini

The only way we could fix it is by always providing all super-globals in every 
context which is a notable performance hit.


[2011-06-30 09:26:36] m dot rondini at tigersecurity dot it

Description:

test1.php
[CODE]
?php
$GLOBALS[_REQUEST][test] = request;
$GLOBALS[_GET][test1] = get;
?
[/CODE]


test2.php
[CODE]
?php
echo $_REQUEST[test];
echo br /;
echo $_GET[test1];
?
[/CODE]


.htaccess
[CODE]
php_value auto_prepend_file ./test1.php
[/CODE]


with this scenario, the only printed variable is $_GET[test1] . However, if I 
append print_r($_REQUEST); in test1.php, it work. 

Expected result:

request
get

Actual result:
--

get






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55088edit=1


Bug #55088 [Com]: $GLOBALS[_REQUEST][something] not set variable on auto_prepend_file

2011-07-06 Thread m dot rondini at tigersecurity dot it
Edit report at https://bugs.php.net/bug.php?id=55088edit=1

 ID: 55088
 Comment by: m dot rondini at tigersecurity dot it
 Reported by:m dot rondini at tigersecurity dot it
 Summary:$GLOBALS[_REQUEST][something] not set variable
 on auto_prepend_file
 Status: Wont fix
 Type:   Bug
 Package:*General Issues
 Operating System:   Linux
 PHP Version:5.3.6
 Block user comment: N
 Private report: N

 New Comment:

ok right, but in php.net documentation i read this:

[phpnet]
auto_prepend_file string
Specifies the name of a file that is automatically parsed before the main file. 
The file is included as if it was called with the require() function, so 
include_path is used.

The special value none disables auto-prepending.
[/phpnet]

It use a require, and the output must be the same..


Previous Comments:

[2011-07-06 09:00:10] johan...@php.net

If you include test1.php from test2.php the engine will first compile and 
execute test2.php. test2.php references $_REQUEST using that name and all so it 
will be initialized and added to the symbol table (in this case the global 
symbol table). Then test1.php will be compiled and executed, also using the 
global symbol table, which still contains $_REQUEST.


[2011-07-06 05:59:23] m dot rondini at tigersecurity dot it

why, if i use require('test1.php'); in test2.php, work it fine?
After prepend require, the return is requestbr /get, how i would see. 
But, 
using auto_prepend_file, something wrong. Is It a bug or other?


[2011-07-06 05:06:40] johan...@php.net

Super-Globals ($_GET / $_REQUEST / $_SESSION / ...) are optimized that they are 
only provided if the parser detects them being used. If you write 
$GLOBALS[_REQUEST] only this won't be detected.

You can fix the issue by writing

$_REQUEST[test] = request;
$_GET[test1] = get;

or by setting auto_globals_jit=0 in php.ini

The only way we could fix it is by always providing all super-globals in every 
context which is a notable performance hit.


[2011-06-30 09:26:36] m dot rondini at tigersecurity dot it

Description:

test1.php
[CODE]
?php
$GLOBALS[_REQUEST][test] = request;
$GLOBALS[_GET][test1] = get;
?
[/CODE]


test2.php
[CODE]
?php
echo $_REQUEST[test];
echo br /;
echo $_GET[test1];
?
[/CODE]


.htaccess
[CODE]
php_value auto_prepend_file ./test1.php
[/CODE]


with this scenario, the only printed variable is $_GET[test1] . However, if I 
append print_r($_REQUEST); in test1.php, it work. 

Expected result:

request
get

Actual result:
--

get






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55088edit=1


[PHP-BUG] Bug #55088 [NEW]: $GLOBALS[_REQUEST][something] not set variable on auto_prepend_file

2011-06-30 Thread m dot rondini at tigersecurity dot it
From: 
Operating system: Linux
PHP version:  5.3.6
Package:  *General Issues
Bug Type: Bug
Bug description:$GLOBALS[_REQUEST][something] not set variable on 
auto_prepend_file 

Description:

test1.php
[CODE]
?php
$GLOBALS[_REQUEST][test] = request;
$GLOBALS[_GET][test1] = get;
?
[/CODE]


test2.php
[CODE]
?php
echo $_REQUEST[test];
echo br /;
echo $_GET[test1];
?
[/CODE]


.htaccess
[CODE]
php_value auto_prepend_file ./test1.php
[/CODE]


with this scenario, the only printed variable is $_GET[test1] . However,
if I 
append print_r($_REQUEST); in test1.php, it work. 

Expected result:

request
get

Actual result:
--

get

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55088edit=1
-- 
Try a snapshot (PHP 5.2):
https://bugs.php.net/fix.php?id=55088r=trysnapshot52
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55088r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55088r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55088r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55088r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55088r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55088r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55088r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55088r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55088r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55088r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55088r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55088r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55088r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55088r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55088r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55088r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55088r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55088r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55088r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55088r=mysqlcfg
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55088r=trysnapshot54