PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - main - php_variables.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 425 486 87.4 %
Date: 2014-07-23 Functions: 15 17 88.2 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :    +----------------------------------------------------------------------+
       3             :    | PHP Version 5                                                        |
       4             :    +----------------------------------------------------------------------+
       5             :    | Copyright (c) 1997-2013 The PHP Group                                |
       6             :    +----------------------------------------------------------------------+
       7             :    | This source file is subject to version 3.01 of the PHP license,      |
       8             :    | that is bundled with this package in the file LICENSE, and is        |
       9             :    | available through the world-wide-web at the following url:           |
      10             :    | http://www.php.net/license/3_01.txt                                  |
      11             :    | If you did not receive a copy of the PHP license and are unable to   |
      12             :    | obtain it through the world-wide-web, please send a note to          |
      13             :    | license@php.net so we can mail you a copy immediately.               |
      14             :    +----------------------------------------------------------------------+
      15             :    | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
      16             :    |          Zeev Suraski <zeev@zend.com>                                |
      17             :    +----------------------------------------------------------------------+
      18             :  */
      19             : 
      20             : /* $Id$ */
      21             : 
      22             : #include <stdio.h>
      23             : #include "php.h"
      24             : #include "ext/standard/php_standard.h"
      25             : #include "ext/standard/credits.h"
      26             : #include "php_variables.h"
      27             : #include "php_globals.h"
      28             : #include "php_content_types.h"
      29             : #include "SAPI.h"
      30             : #include "php_logos.h"
      31             : #include "zend_globals.h"
      32             : 
      33             : /* for systems that need to override reading of environment variables */
      34             : void _php_import_environment_variables(zval *array_ptr TSRMLS_DC);
      35             : PHPAPI void (*php_import_environment_variables)(zval *array_ptr TSRMLS_DC) = _php_import_environment_variables;
      36             : 
      37     1786317 : PHPAPI void php_register_variable(char *var, char *strval, zval *track_vars_array TSRMLS_DC)
      38             : {
      39     1786317 :         php_register_variable_safe(var, strval, strlen(strval), track_vars_array TSRMLS_CC);
      40     1786317 : }
      41             : 
      42             : /* binary-safe version */
      43     1786530 : PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zval *track_vars_array TSRMLS_DC)
      44             : {
      45             :         zval new_entry;
      46             :         assert(strval != NULL);
      47             :         
      48             :         /* Prepare value */
      49     1786530 :         Z_STRLEN(new_entry) = str_len;
      50     1786530 :         if (PG(magic_quotes_gpc)) {
      51         213 :                 Z_STRVAL(new_entry) = php_addslashes(strval, Z_STRLEN(new_entry), &Z_STRLEN(new_entry), 0 TSRMLS_CC);
      52             :         } else {
      53     1786317 :                 Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry));
      54             :         }
      55     1786530 :         Z_TYPE(new_entry) = IS_STRING;
      56             : 
      57     1786530 :         php_register_variable_ex(var, &new_entry, track_vars_array TSRMLS_CC);
      58     1786530 : }
      59             : 
      60     1997180 : PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars_array TSRMLS_DC)
      61             : {
      62     1997180 :         char *p = NULL;
      63             :         char *ip;               /* index pointer */
      64     1997180 :         char *index, *escaped_index = NULL;
      65             :         char *var, *var_orig;
      66             :         int var_len, index_len;
      67             :         zval *gpc_element, **gpc_element_p;
      68     1997180 :         zend_bool is_array = 0;
      69     1997180 :         HashTable *symtable1 = NULL;
      70             : 
      71             :         assert(var_name != NULL);
      72             : 
      73     1997180 :         if (track_vars_array) {
      74     1997062 :                 symtable1 = Z_ARRVAL_P(track_vars_array);
      75         118 :         } else if (PG(register_globals)) {
      76          30 :                 if (!EG(active_symbol_table)) {
      77           6 :                         zend_rebuild_symbol_table(TSRMLS_C);
      78             :                 }
      79          30 :                 symtable1 = EG(active_symbol_table);
      80             :         }
      81     1997180 :         if (!symtable1) {
      82             :                 /* Nothing to do */
      83          88 :                 zval_dtor(val);
      84          88 :                 return;
      85             :         }
      86             : 
      87             :         /*
      88             :          * Prepare variable name
      89             :          */
      90             : 
      91     1997092 :         var_orig = estrdup(var_name);
      92     1997092 :         var = var_orig;
      93             :         /* ignore leading spaces in the variable name */
      94     3994194 :         while (*var && *var==' ') {
      95          10 :                 var++;
      96             :         }
      97             : 
      98             :         /* ensure that we don't have spaces or dots in the variable name (not binary safe) */
      99    28228822 :         for (p = var; *p; p++) {
     100    26232666 :                 if (*p == ' ' || *p == '.') {
     101         682 :                         *p='_';
     102    26231302 :                 } else if (*p == '[') {
     103         254 :                         is_array = 1;
     104         254 :                         ip = p;
     105         254 :                         *p = 0;
     106         254 :                         break;
     107             :                 }
     108             :         }
     109     1997092 :         var_len = p - var;
     110             : 
     111     1997092 :         if (var_len==0) { /* empty variable name, or variable name with a space in it */
     112           2 :                 zval_dtor(val);
     113           2 :                 efree(var_orig);
     114           2 :                 return;
     115             :         }
     116             : 
     117             :         /* GLOBALS hijack attempt, reject parameter */
     118     1997094 :         if (symtable1 == EG(active_symbol_table) &&
     119             :                 var_len == sizeof("GLOBALS")-1 &&
     120           4 :                 !memcmp(var, "GLOBALS", sizeof("GLOBALS")-1)) {
     121           0 :                 zval_dtor(val);
     122           0 :                 efree(var_orig);
     123           0 :                 return;
     124             :         }
     125             : 
     126     1997090 :         index = var;
     127     1997090 :         index_len = var_len;
     128             : 
     129     1997090 :         if (is_array) {
     130         254 :                 int nest_level = 0;
     131             :                 while (1) {
     132             :                         char *index_s;
     133         347 :                         int new_idx_len = 0;
     134             : 
     135         347 :                         if(++nest_level > PG(max_input_nesting_level)) {
     136             :                                 HashTable *ht;
     137             :                                 /* too many levels of nesting */
     138             : 
     139           8 :                                 if (track_vars_array) {
     140           8 :                                         ht = Z_ARRVAL_P(track_vars_array);
     141           8 :                                         zend_symtable_del(ht, var, var_len + 1);
     142           0 :                                 } else if (PG(register_globals)) {
     143           0 :                                         ht = EG(active_symbol_table);
     144           0 :                                         zend_symtable_del(ht, var, var_len + 1);
     145             :                                 }
     146             : 
     147           8 :                                 zval_dtor(val);
     148             : 
     149             :                                 /* do not output the error message to the screen,
     150             :                                  this helps us to to avoid "information disclosure" */
     151           8 :                                 if (!PG(display_errors)) {
     152           2 :                                         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variable nesting level exceeded %ld. To increase the limit change max_input_nesting_level in php.ini.", PG(max_input_nesting_level));
     153             :                                 }
     154           8 :                                 efree(var_orig);
     155           8 :                                 return;
     156             :                         }
     157             : 
     158         339 :                         ip++;
     159         339 :                         index_s = ip;
     160         339 :                         if (isspace(*ip)) {
     161           0 :                                 ip++;
     162             :                         }
     163         339 :                         if (*ip==']') {
     164         130 :                                 index_s = NULL;
     165             :                         } else {
     166         209 :                                 ip = strchr(ip, ']');
     167         209 :                                 if (!ip) {
     168             :                                         /* PHP variables cannot contain '[' in their names, so we replace the character with a '_' */
     169           4 :                                         *(index_s - 1) = '_';
     170             : 
     171           4 :                                         index_len = 0;
     172           4 :                                         if (index) {
     173           4 :                                                 index_len = strlen(index);
     174             :                                         }
     175           4 :                                         goto plain_var;
     176             :                                         return;
     177             :                                 }
     178         205 :                                 *ip = 0;
     179         205 :                                 new_idx_len = strlen(index_s);  
     180             :                         }
     181             : 
     182         335 :                         if (!index) {
     183          38 :                                 MAKE_STD_ZVAL(gpc_element);
     184          38 :                                 array_init(gpc_element);
     185          38 :                                 if (zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p) == FAILURE) {
     186           0 :                                         zval_ptr_dtor(&gpc_element);
     187           0 :                                         zval_dtor(val);
     188           0 :                                         efree(var_orig);
     189           0 :                                         return;
     190             :                                 }
     191             :                         } else {
     192         297 :                                 if (PG(magic_quotes_gpc)) {
     193         287 :                                         escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
     194             :                                 } else {
     195          10 :                                         escaped_index = index;
     196             :                                 }
     197         780 :                                 if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE
     198         780 :                                         || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
     199         117 :                                         MAKE_STD_ZVAL(gpc_element);
     200         117 :                                         array_init(gpc_element);
     201         117 :                                         zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
     202             :                                 }
     203         297 :                                 if (index != escaped_index) {
     204         287 :                                         efree(escaped_index);
     205             :                                 }
     206             :                         }
     207         335 :                         symtable1 = Z_ARRVAL_PP(gpc_element_p);
     208             :                         /* ip pointed to the '[' character, now obtain the key */
     209         335 :                         index = index_s;
     210         335 :                         index_len = new_idx_len;
     211             : 
     212         335 :                         ip++;
     213         335 :                         if (*ip == '[') {
     214          93 :                                 is_array = 1;
     215          93 :                                 *ip = 0;
     216             :                         } else {
     217         242 :                                 goto plain_var;
     218             :                         }
     219          93 :                 }
     220             :         } else {
     221             : plain_var:
     222     1997082 :                 MAKE_STD_ZVAL(gpc_element);
     223     1997082 :                 gpc_element->value = val->value;
     224     1997082 :                 Z_TYPE_P(gpc_element) = Z_TYPE_P(val);
     225     1997082 :                 if (!index) {
     226          88 :                         if (zend_hash_next_index_insert(symtable1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p) == FAILURE) {
     227           0 :                                 zval_ptr_dtor(&gpc_element);
     228             :                         }
     229             :                 } else {
     230     1996994 :                         if (PG(magic_quotes_gpc)) { 
     231         823 :                                 escaped_index = php_addslashes(index, index_len, &index_len, 0 TSRMLS_CC);
     232             :                         } else {
     233     1996171 :                                 escaped_index = index;
     234             :                         }
     235             :                         /* 
     236             :                          * According to rfc2965, more specific paths are listed above the less specific ones.
     237             :                          * If we encounter a duplicate cookie name, we should skip it, since it is not possible
     238             :                          * to have the same (plain text) cookie name for the same path and we should not overwrite
     239             :                          * more specific cookies with the less specific ones.
     240             :                          */
     241     3099970 :                         if (PG(http_globals)[TRACK_VARS_COOKIE] &&
     242     1102937 :                                 symtable1 == Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) &&
     243          35 :                                 zend_symtable_exists(symtable1, escaped_index, index_len + 1)) {
     244           4 :                                 zval_ptr_dtor(&gpc_element);
     245             :                         } else {
     246     1996990 :                                 zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
     247             :                         }
     248     1996994 :                         if (escaped_index != index) {
     249         823 :                                 efree(escaped_index);
     250             :                         }
     251             :                 }
     252             :         }
     253     1997082 :         efree(var_orig);
     254             : }
     255             : 
     256          33 : SAPI_API SAPI_POST_HANDLER_FUNC(php_std_post_handler)
     257             : {
     258             :         char *var, *val, *e, *s, *p;
     259          33 :         zval *array_ptr = (zval *) arg;
     260          33 :         long count = 0;
     261             : 
     262          33 :         if (SG(request_info).post_data == NULL) {
     263           0 :                 return;
     264             :         }       
     265             : 
     266          33 :         s = SG(request_info).post_data;
     267          33 :         e = s + SG(request_info).post_data_length;
     268             : 
     269         147 :         while (s < e && (p = memchr(s, '&', (e - s)))) {
     270             : last_value:
     271          81 :                 if ((val = memchr(s, '=', (p - s)))) { /* have a value */
     272             :                         unsigned int val_len, new_val_len;
     273             : 
     274          78 :                         if (++count > PG(max_input_vars)) {
     275           0 :                                 php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
     276           0 :                                 return;
     277             :                         }
     278          78 :                         var = s;
     279             : 
     280          78 :                         php_url_decode(var, (val - s));
     281          78 :                         val++;
     282          78 :                         val_len = php_url_decode(val, (p - val));
     283          78 :                         val = estrndup(val, val_len);
     284          78 :                         if (sapi_module.input_filter(PARSE_POST, var, &val, val_len, &new_val_len TSRMLS_CC)) {
     285           0 :                                 php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
     286             :                         }
     287          78 :                         efree(val);
     288             :                 }
     289          81 :                 s = p + 1;
     290             :         }
     291          66 :         if (s < e) {
     292          33 :                 p = e;
     293          33 :                 goto last_value;
     294             :         }
     295             : }
     296             : 
     297           0 : SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter)
     298             : {
     299             :         /* TODO: check .ini setting here and apply user-defined input filter */
     300           0 :         if(new_val_len) *new_val_len = val_len;
     301           0 :         return 1;
     302             : }
     303             : 
     304       38709 : SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data)
     305             : {
     306       38709 :         char *res = NULL, *var, *val, *separator = NULL;
     307             :         const char *c_var;
     308             :         zval *array_ptr;
     309       38709 :         int free_buffer = 0;
     310       38709 :         char *strtok_buf = NULL;
     311       38709 :         long count = 0;
     312             :         
     313       38709 :         switch (arg) {
     314             :                 case PARSE_POST:
     315             :                 case PARSE_GET:
     316             :                 case PARSE_COOKIE:
     317       38679 :                         ALLOC_ZVAL(array_ptr);
     318       38679 :                         array_init(array_ptr);
     319       38679 :                         INIT_PZVAL(array_ptr);
     320       38679 :                         switch (arg) {
     321             :                                 case PARSE_POST:
     322          57 :                                         if (PG(http_globals)[TRACK_VARS_POST]) {
     323           0 :                                                 zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_POST]);
     324             :                                         }
     325          57 :                                         PG(http_globals)[TRACK_VARS_POST] = array_ptr;
     326          57 :                                         break;
     327             :                                 case PARSE_GET:
     328       19315 :                                         if (PG(http_globals)[TRACK_VARS_GET]) {
     329           0 :                                                 zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_GET]);
     330             :                                         }
     331       19315 :                                         PG(http_globals)[TRACK_VARS_GET] = array_ptr;
     332       19315 :                                         break;
     333             :                                 case PARSE_COOKIE:
     334       19307 :                                         if (PG(http_globals)[TRACK_VARS_COOKIE]) {
     335           0 :                                                 zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_COOKIE]);
     336             :                                         }
     337       19307 :                                         PG(http_globals)[TRACK_VARS_COOKIE] = array_ptr;
     338             :                                         break;
     339             :                         }
     340       38679 :                         break;
     341             :                 default:
     342          30 :                         array_ptr = destArray;
     343             :                         break;
     344             :         }
     345             : 
     346       38709 :         if (arg == PARSE_POST) {
     347          57 :                 sapi_handle_post(array_ptr TSRMLS_CC);
     348          57 :                 return;
     349             :         }
     350             : 
     351       38652 :         if (arg == PARSE_GET) {         /* GET data */
     352       19315 :                 c_var = SG(request_info).query_string;
     353       19494 :                 if (c_var && *c_var) {
     354         179 :                         res = (char *) estrdup(c_var);
     355         179 :                         free_buffer = 1;
     356             :                 } else {
     357       19136 :                         free_buffer = 0;
     358             :                 }
     359       19337 :         } else if (arg == PARSE_COOKIE) {               /* Cookie data */
     360       19307 :                 c_var = SG(request_info).cookie_data;
     361       19313 :                 if (c_var && *c_var) {
     362           6 :                         res = (char *) estrdup(c_var);
     363           6 :                         free_buffer = 1;
     364             :                 } else {
     365       19301 :                         free_buffer = 0;
     366             :                 }
     367          30 :         } else if (arg == PARSE_STRING) {               /* String data */
     368          30 :                 res = str;
     369          30 :                 free_buffer = 1;
     370             :         }
     371             : 
     372       38652 :         if (!res) {
     373       38437 :                 return;
     374             :         }
     375             : 
     376         215 :         switch (arg) {
     377             :                 case PARSE_GET:
     378             :                 case PARSE_STRING:
     379         209 :                         separator = (char *) estrdup(PG(arg_separator).input);
     380         209 :                         break;
     381             :                 case PARSE_COOKIE:
     382           6 :                         separator = ";\0";
     383             :                         break;
     384             :         }
     385             :         
     386         215 :         var = php_strtok_r(res, separator, &strtok_buf);
     387             :         
     388         750 :         while (var) {
     389         320 :                 val = strchr(var, '=');
     390             : 
     391         320 :                 if (arg == PARSE_COOKIE) {
     392             :                         /* Remove leading spaces from cookie names, needed for multi-cookie header where ; can be followed by a space */
     393          86 :                         while (isspace(*var)) {
     394          10 :                                 var++;
     395             :                         }
     396          38 :                         if (var == val || *var == '\0') {
     397             :                                 goto next_cookie;
     398             :                         }
     399             :                 }
     400             : 
     401         320 :                 if (++count > PG(max_input_vars)) {
     402           0 :                         php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
     403           0 :                         break;
     404             :                 }
     405             : 
     406         320 :                 if (val) { /* have a value */
     407             :                         int val_len;
     408             :                         unsigned int new_val_len;
     409             : 
     410         162 :                         *val++ = '\0';
     411         162 :                         php_url_decode(var, strlen(var));
     412         162 :                         val_len = php_url_decode(val, strlen(val));
     413         162 :                         val = estrndup(val, val_len);
     414         162 :                         if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
     415          68 :                                 php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
     416             :                         }
     417         162 :                         efree(val);
     418             :                 } else {
     419             :                         int val_len;
     420             :                         unsigned int new_val_len;
     421             : 
     422         158 :                         php_url_decode(var, strlen(var));
     423         158 :                         val_len = 0;
     424         158 :                         val = estrndup("", val_len);
     425         158 :                         if (sapi_module.input_filter(arg, var, &val, val_len, &new_val_len TSRMLS_CC)) {
     426           0 :                                 php_register_variable_safe(var, val, new_val_len, array_ptr TSRMLS_CC);
     427             :                         }
     428         158 :                         efree(val);
     429             :                 }
     430             : next_cookie:
     431         320 :                 var = php_strtok_r(NULL, separator, &strtok_buf);
     432             :         }
     433             : 
     434         215 :         if (arg != PARSE_COOKIE) {
     435         209 :                 efree(separator);
     436             :         }
     437             : 
     438         215 :         if (free_buffer) {
     439         215 :                 efree(res);
     440             :         }
     441             : }
     442             : 
     443       38637 : void _php_import_environment_variables(zval *array_ptr TSRMLS_DC)
     444             : {
     445             :         char buf[128];
     446       38637 :         char **env, *p, *t = buf;
     447       38637 :         size_t alloc_size = sizeof(buf);
     448             :         unsigned long nlen; /* ptrdiff_t is not portable */
     449             : 
     450             :         /* turn off magic_quotes while importing environment variables */
     451       38637 :         int magic_quotes_gpc = PG(magic_quotes_gpc);
     452             : 
     453       38637 :         if (magic_quotes_gpc) {
     454       19307 :                 zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC);
     455             :         }
     456             : 
     457     1824954 :         for (env = environ; env != NULL && *env != NULL; env++) {
     458     1786317 :                 p = strchr(*env, '=');
     459     1786317 :                 if (!p) {                               /* malformed entry? */
     460           0 :                         continue;
     461             :                 }
     462     1786317 :                 nlen = p - *env;
     463     1786317 :                 if (nlen >= alloc_size) {
     464           0 :                         alloc_size = nlen + 64;
     465           0 :                         t = (t == buf ? emalloc(alloc_size): erealloc(t, alloc_size));
     466             :                 }
     467     1786317 :                 memcpy(t, *env, nlen);
     468     1786317 :                 t[nlen] = '\0';
     469     1786317 :                 php_register_variable(t, p + 1, array_ptr TSRMLS_CC);
     470             :         }
     471       38637 :         if (t != buf && t != NULL) {
     472           0 :                 efree(t);
     473             :         }
     474             : 
     475       38637 :         if (magic_quotes_gpc) {
     476       19307 :                 zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "1", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC);
     477             :         }
     478       38637 : }
     479             : 
     480           0 : zend_bool php_std_auto_global_callback(char *name, uint name_len TSRMLS_DC)
     481             : {
     482           0 :         zend_printf("%s\n", name);
     483           0 :         return 0; /* don't rearm */
     484             : }
     485             : 
     486             : /* {{{ php_build_argv
     487             :  */
     488       19325 : static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
     489             : {
     490             :         zval *arr, *argc, *tmp;
     491       19325 :         int count = 0;
     492             :         char *ss, *space;
     493             :         
     494       19325 :         if (!(PG(register_globals) || SG(request_info).argc || track_vars_array)) {
     495           3 :                 return;
     496             :         }
     497             :         
     498       19322 :         ALLOC_INIT_ZVAL(arr);
     499       19322 :         array_init(arr);
     500             : 
     501             :         /* Prepare argv */
     502       19322 :         if (SG(request_info).argc) { /* are we in cli sapi? */
     503             :                 int i;
     504       38282 :                 for (i = 0; i < SG(request_info).argc; i++) {
     505       19168 :                         ALLOC_ZVAL(tmp);
     506       19168 :                         Z_TYPE_P(tmp) = IS_STRING;
     507       19168 :                         Z_STRLEN_P(tmp) = strlen(SG(request_info).argv[i]);
     508       19168 :                         Z_STRVAL_P(tmp) = estrndup(SG(request_info).argv[i], Z_STRLEN_P(tmp));
     509       19168 :                         INIT_PZVAL(tmp);
     510       19168 :                         if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) {
     511           0 :                                 if (Z_TYPE_P(tmp) == IS_STRING) {
     512           0 :                                         efree(Z_STRVAL_P(tmp));
     513             :                                 }
     514             :                         }
     515             :                 }
     516         208 :         } else  if (s && *s) {
     517          25 :                 ss = s;
     518          82 :                 while (ss) {
     519          32 :                         space = strchr(ss, '+');
     520          32 :                         if (space) {
     521           7 :                                 *space = '\0';
     522             :                         }
     523             :                         /* auto-type */
     524          32 :                         ALLOC_ZVAL(tmp);
     525          32 :                         Z_TYPE_P(tmp) = IS_STRING;
     526          32 :                         Z_STRLEN_P(tmp) = strlen(ss);
     527          32 :                         Z_STRVAL_P(tmp) = estrndup(ss, Z_STRLEN_P(tmp));
     528          32 :                         INIT_PZVAL(tmp);
     529          32 :                         count++;
     530          32 :                         if (zend_hash_next_index_insert(Z_ARRVAL_P(arr), &tmp, sizeof(zval *), NULL) == FAILURE) {
     531           0 :                                 if (Z_TYPE_P(tmp) == IS_STRING) {
     532           0 :                                         efree(Z_STRVAL_P(tmp));
     533             :                                 }
     534             :                         }
     535          32 :                         if (space) {
     536           7 :                                 *space = '+';
     537           7 :                                 ss = space + 1;
     538             :                         } else {
     539          25 :                                 ss = space;
     540             :                         }
     541             :                 }
     542             :         }
     543             : 
     544             :         /* prepare argc */
     545       19322 :         ALLOC_INIT_ZVAL(argc);
     546       19322 :         if (SG(request_info).argc) {
     547       19114 :                 Z_LVAL_P(argc) = SG(request_info).argc;
     548             :         } else {
     549         208 :                 Z_LVAL_P(argc) = count;
     550             :         }
     551       19322 :         Z_TYPE_P(argc) = IS_LONG;
     552             : 
     553       19322 :         if (PG(register_globals) || SG(request_info).argc) {
     554       19115 :                 Z_ADDREF_P(arr);
     555       19115 :                 Z_ADDREF_P(argc);
     556       19115 :                 zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL);
     557       19115 :                 zend_hash_add(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL);
     558             :         } 
     559       19322 :         if (track_vars_array) {
     560       19320 :                 Z_ADDREF_P(arr);
     561       19320 :                 Z_ADDREF_P(argc);
     562       19320 :                 zend_hash_update(Z_ARRVAL_P(track_vars_array), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL);
     563       19320 :                 zend_hash_update(Z_ARRVAL_P(track_vars_array), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL);
     564             :         }
     565       19322 :         zval_ptr_dtor(&arr);
     566       19322 :         zval_ptr_dtor(&argc);
     567             : }
     568             : /* }}} */
     569             : 
     570             : /* {{{ php_handle_special_queries
     571             :  */
     572       19245 : PHPAPI int php_handle_special_queries(TSRMLS_D)
     573             : {
     574       19245 :         if (PG(expose_php) && SG(request_info).query_string && SG(request_info).query_string[0] == '=') {
     575           0 :                 if (php_info_logos(SG(request_info).query_string + 1 TSRMLS_CC)) {
     576           0 :                         return 1;
     577           0 :                 } else if (!strcmp(SG(request_info).query_string + 1, PHP_CREDITS_GUID)) {
     578           0 :                         php_print_credits(PHP_CREDITS_ALL TSRMLS_CC);
     579           0 :                         return 1;
     580             :                 }
     581             :         }
     582       19245 :         return 0;
     583             : }
     584             : /* }}} */
     585             : 
     586             : /* {{{ php_register_server_variables
     587             :  */
     588       19322 : static inline void php_register_server_variables(TSRMLS_D)
     589             : {
     590       19322 :         zval *array_ptr = NULL;
     591             :         /* turn off magic_quotes while importing server variables */
     592       19322 :         int magic_quotes_gpc = PG(magic_quotes_gpc);
     593             : 
     594       19322 :         ALLOC_ZVAL(array_ptr);
     595       19322 :         array_init(array_ptr);
     596       19322 :         INIT_PZVAL(array_ptr);
     597       19322 :         if (PG(http_globals)[TRACK_VARS_SERVER]) {
     598           0 :                 zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]);
     599             :         }
     600       19322 :         PG(http_globals)[TRACK_VARS_SERVER] = array_ptr;
     601       19322 :         if (magic_quotes_gpc) {
     602       19314 :                 zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC);
     603             :         }
     604             : 
     605             :         /* Server variables */
     606       19322 :         if (sapi_module.register_server_variables) {
     607       19322 :                 sapi_module.register_server_variables(array_ptr TSRMLS_CC);
     608             :         }
     609             : 
     610             :         /* PHP Authentication support */
     611       19322 :         if (SG(request_info).auth_user) {
     612           0 :                 php_register_variable("PHP_AUTH_USER", SG(request_info).auth_user, array_ptr TSRMLS_CC);
     613             :         }
     614       19322 :         if (SG(request_info).auth_password) {
     615           0 :                 php_register_variable("PHP_AUTH_PW", SG(request_info).auth_password, array_ptr TSRMLS_CC);
     616             :         }
     617       19322 :         if (SG(request_info).auth_digest) {
     618           0 :                 php_register_variable("PHP_AUTH_DIGEST", SG(request_info).auth_digest, array_ptr TSRMLS_CC);
     619             :         }
     620             :         /* store request init time */
     621             :         {
     622             :                 zval new_entry;
     623       19322 :                 Z_TYPE(new_entry) = IS_LONG;
     624       19322 :                 Z_LVAL(new_entry) = sapi_get_request_time(TSRMLS_C);
     625       19322 :                 php_register_variable_ex("REQUEST_TIME", &new_entry, array_ptr TSRMLS_CC);
     626             :         }
     627             : 
     628       19322 :         if (magic_quotes_gpc) {
     629       19314 :                 zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "1", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC);
     630             :         }
     631       19322 : }
     632             : /* }}} */
     633             : 
     634             : /* {{{ php_autoglobal_merge
     635             :  */
     636       58079 : static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
     637             : {
     638             :         zval **src_entry, **dest_entry;
     639             :         char *string_key;
     640             :         uint string_key_len;
     641             :         ulong num_key;
     642             :         HashPosition pos;
     643             :         int key_type;
     644       58079 :         int globals_check = (PG(register_globals) && (dest == (&EG(symbol_table))));
     645             : 
     646       58079 :         zend_hash_internal_pointer_reset_ex(src, &pos);
     647      119066 :         while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) == SUCCESS) {
     648        2908 :                 key_type = zend_hash_get_current_key_ex(src, &string_key, &string_key_len, &num_key, 0, &pos);
     649        8741 :                 if (Z_TYPE_PP(src_entry) != IS_ARRAY
     650        2924 :                         || (key_type == HASH_KEY_IS_STRING && zend_hash_find(dest, string_key, string_key_len, (void **) &dest_entry) != SUCCESS)
     651           1 :                         || (key_type == HASH_KEY_IS_LONG && zend_hash_index_find(dest, num_key, (void **)&dest_entry) != SUCCESS)
     652           0 :                         || Z_TYPE_PP(dest_entry) != IS_ARRAY
     653             :         ) {
     654        2908 :                         Z_ADDREF_PP(src_entry);
     655        2908 :                         if (key_type == HASH_KEY_IS_STRING) {
     656             :                                 /* if register_globals is on and working with main symbol table, prevent overwriting of GLOBALS */
     657        5752 :                                 if (!globals_check || string_key_len != sizeof("GLOBALS") || memcmp(string_key, "GLOBALS", sizeof("GLOBALS") - 1)) {
     658        2876 :                                         zend_hash_update(dest, string_key, string_key_len, src_entry, sizeof(zval *), NULL);
     659             :                                 } else {
     660           0 :                                         Z_DELREF_PP(src_entry);
     661             :                                 }
     662             :                         } else {
     663          32 :                                 zend_hash_index_update(dest, num_key, src_entry, sizeof(zval *), NULL);
     664             :                         }
     665             :                 } else {
     666           0 :                         SEPARATE_ZVAL(dest_entry);
     667           0 :                         php_autoglobal_merge(Z_ARRVAL_PP(dest_entry), Z_ARRVAL_PP(src_entry) TSRMLS_CC);
     668             :                 }
     669        2908 :                 zend_hash_move_forward_ex(src, &pos);
     670             :         }
     671       58079 : }
     672             : /* }}} */
     673             : 
     674             : static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC);
     675             : static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC);
     676             : static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC);
     677             : 
     678             : /* {{{ php_hash_environment
     679             :  */
     680       19327 : int php_hash_environment(TSRMLS_D)
     681             : {
     682             :         char *p;
     683       19327 :         unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0};
     684       19327 :         zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays));
     685             :         struct auto_global_record {
     686             :                 char *name;
     687             :                 uint name_len;
     688             :                 char *long_name;
     689             :                 uint long_name_len;
     690             :                 zend_bool jit_initialization;
     691             :         } auto_global_records[] = {
     692             :                 { "_POST", sizeof("_POST"), "HTTP_POST_VARS", sizeof("HTTP_POST_VARS"), 0 },
     693             :                 { "_GET", sizeof("_GET"), "HTTP_GET_VARS", sizeof("HTTP_GET_VARS"), 0 },
     694             :                 { "_COOKIE", sizeof("_COOKIE"), "HTTP_COOKIE_VARS", sizeof("HTTP_COOKIE_VARS"), 0 },
     695             :                 { "_SERVER", sizeof("_SERVER"), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), 1 },
     696             :                 { "_ENV", sizeof("_ENV"), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), 1 },
     697             :                 { "_FILES", sizeof("_FILES"), "HTTP_POST_FILES", sizeof("HTTP_POST_FILES"), 0 },
     698       19327 :         };
     699       19327 :         size_t num_track_vars = sizeof(auto_global_records)/sizeof(struct auto_global_record);
     700             :         size_t i;
     701             : 
     702             :         /* jit_initialization = 0; */
     703      135289 :         for (i=0; i<num_track_vars; i++) {
     704      115962 :                 PG(http_globals)[i] = NULL;
     705             :         }
     706             : 
     707      115934 :         for (p=PG(variables_order); p && *p; p++) {
     708       96607 :                 switch(*p) {
     709             :                         case 'p':
     710             :                         case 'P':
     711       19326 :                                 if (!_gpc_flags[0] && !SG(headers_sent) && SG(request_info).request_method && !strcasecmp(SG(request_info).request_method, "POST")) {
     712          60 :                                         sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC);       /* POST Data */
     713          60 :                                         _gpc_flags[0] = 1;
     714          60 :                                         if (PG(register_globals)) {
     715           1 :                                                 php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
     716             :                                         }
     717             :                                 }
     718       19326 :                                 break;
     719             :                         case 'c':
     720             :                         case 'C':
     721       19318 :                                 if (!_gpc_flags[1]) {
     722       19318 :                                         sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC);     /* Cookie Data */
     723       19318 :                                         _gpc_flags[1] = 1;
     724       19318 :                                         if (PG(register_globals)) {
     725          27 :                                                 php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
     726             :                                         }
     727             :                                 }
     728       19318 :                                 break;
     729             :                         case 'g':
     730             :                         case 'G':
     731       19326 :                                 if (!_gpc_flags[2]) {
     732       19326 :                                         sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);        /* GET Data */
     733       19326 :                                         _gpc_flags[2] = 1;
     734       19326 :                                         if (PG(register_globals)) {
     735          27 :                                                 php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
     736             :                                         }
     737             :                                 }
     738       19326 :                                 break;
     739             :                         case 'e':
     740             :                         case 'E':
     741       19315 :                                 if (!jit_initialization && !_gpc_flags[3]) {
     742       19315 :                                         zend_auto_global_disable_jit("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
     743       19315 :                                         php_auto_globals_create_env("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
     744       19315 :                                         _gpc_flags[3] = 1;
     745       19315 :                                         if (PG(register_globals)) {
     746          27 :                                                 php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV]) TSRMLS_CC);
     747             :                                         }
     748             :                                 }
     749       19315 :                                 break;
     750             :                         case 's':
     751             :                         case 'S':
     752       19322 :                                 if (!jit_initialization && !_gpc_flags[4]) {
     753       19322 :                                         zend_auto_global_disable_jit("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
     754       19322 :                                         php_register_server_variables(TSRMLS_C);
     755       19322 :                                         _gpc_flags[4] = 1;
     756       19322 :                                         if (PG(register_globals)) {
     757          27 :                                                 php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]) TSRMLS_CC);
     758             :                                         }
     759             :                                 }
     760             :                                 break;
     761             :                 }
     762             :         }
     763             : 
     764             :         /* argv/argc support */
     765       19327 :         if (PG(register_argc_argv)) {
     766       19325 :                 php_build_argv(SG(request_info).query_string, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
     767             :         }
     768             : 
     769      135289 :         for (i=0; i<num_track_vars; i++) {
     770      115962 :                 if (jit_initialization && auto_global_records[i].jit_initialization) {
     771           0 :                         continue;
     772             :                 }
     773      115962 :                 if (!PG(http_globals)[i]) {
     774       38601 :                         ALLOC_ZVAL(PG(http_globals)[i]);
     775       38601 :                         array_init(PG(http_globals)[i]);
     776       38601 :                         INIT_PZVAL(PG(http_globals)[i]);
     777             :                 }
     778             : 
     779      115962 :                 Z_ADDREF_P(PG(http_globals)[i]);
     780      115962 :                 zend_hash_update(&EG(symbol_table), auto_global_records[i].name, auto_global_records[i].name_len, &PG(http_globals)[i], sizeof(zval *), NULL);
     781      115962 :                 if (PG(register_long_arrays)) {
     782      115962 :                         zend_hash_update(&EG(symbol_table), auto_global_records[i].long_name, auto_global_records[i].long_name_len, &PG(http_globals)[i], sizeof(zval *), NULL);
     783      115962 :                         Z_ADDREF_P(PG(http_globals)[i]);
     784             :                 }
     785             :         }
     786             : 
     787             :         /* Create _REQUEST */
     788       19327 :         if (!jit_initialization) {
     789       19327 :                 zend_auto_global_disable_jit("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
     790       19327 :                 php_auto_globals_create_request("_REQUEST", sizeof("_REQUEST")-1 TSRMLS_CC);
     791             :         }
     792             : 
     793       19327 :         return SUCCESS;
     794             : }
     795             : /* }}} */
     796             : 
     797           2 : static zend_bool php_auto_globals_create_server(char *name, uint name_len TSRMLS_DC)
     798             : {
     799           2 :         if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) {
     800           0 :                 php_register_server_variables(TSRMLS_C);
     801             : 
     802           0 :                 if (PG(register_argc_argv)) {
     803           0 :                         if (SG(request_info).argc) {
     804             :                                 zval **argc, **argv;
     805             :         
     806           0 :                                 if (zend_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void**)&argc) == SUCCESS &&
     807           0 :                                     zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void**)&argv) == SUCCESS) {
     808           0 :                                         Z_ADDREF_PP(argc);
     809           0 :                                         Z_ADDREF_PP(argv);
     810           0 :                                         zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argv", sizeof("argv"), argv, sizeof(zval *), NULL);
     811           0 :                                         zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "argc", sizeof("argc"), argc, sizeof(zval *), NULL);
     812             :                                 }
     813             :                         } else {
     814           0 :                                 php_build_argv(SG(request_info).query_string, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
     815             :                         }
     816             :                 }
     817             :         
     818             :         } else {
     819           2 :                 zval *server_vars=NULL;
     820           2 :                 ALLOC_ZVAL(server_vars);
     821           2 :                 array_init(server_vars);
     822           2 :                 INIT_PZVAL(server_vars);
     823           2 :                 if (PG(http_globals)[TRACK_VARS_SERVER]) {
     824           2 :                         zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]);
     825             :                 }
     826           2 :                 PG(http_globals)[TRACK_VARS_SERVER] = server_vars;
     827             :         }
     828             : 
     829           2 :         zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL);
     830           2 :         Z_ADDREF_P(PG(http_globals)[TRACK_VARS_SERVER]);
     831             : 
     832           2 :         if (PG(register_long_arrays)) {
     833           2 :                 zend_hash_update(&EG(symbol_table), "HTTP_SERVER_VARS", sizeof("HTTP_SERVER_VARS"), &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL);
     834           2 :                 Z_ADDREF_P(PG(http_globals)[TRACK_VARS_SERVER]);
     835             :         }
     836             :         
     837           2 :         return 0; /* don't rearm */
     838             : }
     839             : 
     840       19316 : static zend_bool php_auto_globals_create_env(char *name, uint name_len TSRMLS_DC)
     841             : {
     842       19316 :         zval *env_vars = NULL;
     843       19316 :         ALLOC_ZVAL(env_vars);
     844       19316 :         array_init(env_vars);
     845       19316 :         INIT_PZVAL(env_vars);
     846       19316 :         if (PG(http_globals)[TRACK_VARS_ENV]) {
     847           1 :                 zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_ENV]);
     848             :         }
     849       19316 :         PG(http_globals)[TRACK_VARS_ENV] = env_vars;
     850             :         
     851       19316 :         if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) {
     852       19315 :                 php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC);
     853             :         }
     854             : 
     855       19316 :         zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL);
     856       19316 :         Z_ADDREF_P(PG(http_globals)[TRACK_VARS_ENV]);
     857             : 
     858       19316 :         if (PG(register_long_arrays)) {
     859       19316 :                 zend_hash_update(&EG(symbol_table), "HTTP_ENV_VARS", sizeof("HTTP_ENV_VARS"), &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL);
     860       19316 :                 Z_ADDREF_P(PG(http_globals)[TRACK_VARS_ENV]);
     861             :         }
     862             : 
     863       19316 :         return 0; /* don't rearm */
     864             : }
     865             : 
     866       19327 : static zend_bool php_auto_globals_create_request(char *name, uint name_len TSRMLS_DC)
     867             : {
     868             :         zval *form_variables;
     869       19327 :         unsigned char _gpc_flags[3] = {0, 0, 0};
     870             :         char *p;
     871             : 
     872       19327 :         ALLOC_ZVAL(form_variables);
     873       19327 :         array_init(form_variables);
     874       19327 :         INIT_PZVAL(form_variables);
     875             : 
     876       19327 :         if(PG(request_order) != NULL) {
     877           0 :                 p = PG(request_order);
     878             :         } else {
     879       19327 :                 p = PG(variables_order);
     880             :         }
     881             : 
     882      115934 :         for (; p && *p; p++) {
     883       96607 :                 switch (*p) {
     884             :                         case 'g':
     885             :                         case 'G':
     886       19326 :                                 if (!_gpc_flags[0]) {
     887       19326 :                                         php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
     888       19326 :                                         _gpc_flags[0] = 1;
     889             :                                 }
     890       19326 :                                 break;
     891             :                         case 'p':
     892             :                         case 'P':
     893       19326 :                                 if (!_gpc_flags[1]) {
     894       19326 :                                         php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
     895       19326 :                                         _gpc_flags[1] = 1;
     896             :                                 }
     897       19326 :                                 break;
     898             :                         case 'c':
     899             :                         case 'C':
     900       19318 :                                 if (!_gpc_flags[2]) {
     901       19318 :                                         php_autoglobal_merge(Z_ARRVAL_P(form_variables), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
     902       19318 :                                         _gpc_flags[2] = 1;
     903             :                                 }
     904             :                                 break;
     905             :                 }
     906             :         }
     907             : 
     908       19327 :         zend_hash_update(&EG(symbol_table), "_REQUEST", sizeof("_REQUEST"), &form_variables, sizeof(zval *), NULL);
     909       19327 :         return 0;
     910             : }
     911             : 
     912       19341 : void php_startup_auto_globals(TSRMLS_D)
     913             : {
     914       19341 :         zend_register_auto_global("_GET", sizeof("_GET")-1, NULL TSRMLS_CC);
     915       19341 :         zend_register_auto_global("_POST", sizeof("_POST")-1, NULL TSRMLS_CC);
     916       19341 :         zend_register_auto_global("_COOKIE", sizeof("_COOKIE")-1, NULL TSRMLS_CC);
     917       19341 :         zend_register_auto_global("_SERVER", sizeof("_SERVER")-1, php_auto_globals_create_server TSRMLS_CC);
     918       19341 :         zend_register_auto_global("_ENV", sizeof("_ENV")-1, php_auto_globals_create_env TSRMLS_CC);
     919       19341 :         zend_register_auto_global("_REQUEST", sizeof("_REQUEST")-1, php_auto_globals_create_request TSRMLS_CC);
     920       19341 :         zend_register_auto_global("_FILES", sizeof("_FILES")-1, NULL TSRMLS_CC);
     921       19341 : }
     922             : 
     923             : /*
     924             :  * Local variables:
     925             :  * tab-width: 4
     926             :  * c-basic-offset: 4
     927             :  * End:
     928             :  * vim600: sw=4 ts=4 fdm=marker
     929             :  * vim<600: sw=4 ts=4
     930             :  */

Generated by: LCOV version 1.10

Generated at Wed, 23 Jul 2014 19:58:45 +0000 (6 hours ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.