Re: filter_input and auto_globals_jit

From: Date: Tue, 03 Jun 2014 07:46:19 +0000
Subject: Re: filter_input and auto_globals_jit
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-74703@lists.php.net to get a copy of this message
On Thu, May 22, 2014 at 11:01 PM, Gary Mort <garyamort@gmail.com> wrote: > Here is an oddity which I'm not sure how this is supposed to work. > > If you have auto_globals_jit enables then not only are super global > variables not initialized unless they are called, the underlying data > storage for the original data[used by filter_input] will not be populated.. > > As I read filter.c, there seems to be a weird schism on how it deals with > this. > õë5m > ?ÌÆF•'|œââEhttps://github.com/php/php-src/blob/master/ext/filter/filter.c#L526 > > For INPUT_SERVER and INPUT_ENV it seems as if filter will make sure to > initialize the data, example: > if (PG(auto_globals_jit)) { > zend_is_auto_global("_SERVER", > sizeof("_SERVER")-1 TSRMLS_CC); > } > > For INPUT_POST, INPUT_GET, and INPUT_COOKIE however there is no safety net. > > For example, with Just in Time: > test.php?var=test > > $before = filter_input(INPUT_GET); // $before = null > $var = $_GET('test'); // $var = 'test' > $after = filter_input(INPUT_GET); // $after = 'test' > > > So the question is, is this by design? In which case I'll update the > docs. Or is this an oversight? In which case I'll open a bug and submit a > patch. > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > could you fill a bug at https://bugs.php.net/ ? -- Ferenc Kovács @Tyr43l - http://tyrael.hu

« previous php.internals (#74703) next »