]> granicus.if.org Git - php/commitdiff
- remove register_globals support (aka "Kill the f***ing thing" :)
authorPierre Joye <pajoye@php.net>
Tue, 7 Mar 2006 00:20:54 +0000 (00:20 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 7 Mar 2006 00:20:54 +0000 (00:20 +0000)
34 files changed:
NEWS
ext/mbstring/mb_gpc.c
ext/mbstring/mb_gpc.h
ext/mbstring/mbstring.c
ext/mbstring/tests/mb_parse_str.phpt
ext/mbstring/tests/mb_parse_str02.phpt
ext/session/php_session.h
ext/session/session.c
ext/session/tests/001.phpt
ext/session/tests/003.phpt
ext/session/tests/004.phpt
ext/session/tests/005.phpt
ext/session/tests/006.phpt
ext/session/tests/007.phpt
ext/session/tests/008-php4.2.3.phpt
ext/session/tests/008.phpt
ext/session/tests/009.phpt
ext/session/tests/010.phpt
ext/session/tests/011.phpt
ext/session/tests/012.phpt
ext/session/tests/013.phpt
ext/session/tests/014.phpt
ext/session/tests/019.phpt
ext/session/tests/bug24592.phpt
ext/session/tests/bug26862.phpt
main/main.c
main/php_globals.h
main/php_variables.c
main/rfc1867.c
php.ini-dist
php.ini-recommended
sapi/apache/mod_php5.c
sapi/apache_hooks/mod_php5.c
sapi/apache_hooks/sapi_apache.c

diff --git a/NEWS b/NEWS
index 9e89b8c89475435f570239f95b93cf47013a55da..88427c937c65416c640030541b73ef0e66784ed3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? ????, PHP 6.0
 - Unicode support. (Andrei, Dmitry, et al)
+- Droped register_globals support (Pierre)
+  - session_register, session_unregister and session_is_registered removed they
+    depend on register_globals
 - Cleaned CGI code. Now FastCGI can not be disabled. See sapi/cgi/CHANGES
   for more details. (Dmitry)
 - Removed support for "continue" and "break" operators with non-constant
index 8cfe56a4d14c29c4b652520bf82913ca189fd31f..59bf838886e32d9969b28ca8065c3840c37575fe 100644 (file)
@@ -146,7 +146,6 @@ MBSTRING_API SAPI_TREAT_DATA_FUNC(mbstr_treat_data)
 
        info.data_type              = arg;
        info.separator              = separator; 
-       info.force_register_globals = 0;
        info.report_errors          = 0;
        info.to_encoding            = MBSTRG(internal_encoding);
        info.to_language            = MBSTRG(language);
@@ -203,14 +202,6 @@ enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_
        mbfl_string_init_set(&resvar, info->to_language, info->to_encoding);
        mbfl_string_init_set(&resval, info->to_language, info->to_encoding);
 
-       /* register_globals stuff
-        * XXX: this feature is going to be deprecated? */
-
-       if (info->force_register_globals) {
-               prev_rg_state = PG(register_globals);
-               PG(register_globals) = 1;
-       }
-
        if (!res || *res == '\0') {
                goto out;
        }
@@ -340,11 +331,6 @@ enum mbfl_no_encoding _php_mb_encoding_handler_ex(const php_mb_encoding_handler_
        }
 
 out:
-       /* register_global stuff */
-       if (info->force_register_globals) {
-               PG(register_globals) = prev_rg_state;
-       }
-
        if (convd != NULL) {
                mbfl_buffer_converter_delete(convd);
        }
@@ -369,7 +355,6 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler)
 
        info.data_type              = PARSE_POST;
        info.separator              = "&";
-       info.force_register_globals = 0;
        info.report_errors          = 0;
        info.to_encoding            = MBSTRG(internal_encoding);
        info.to_language            = MBSTRG(language);
index 593b413253ae7ee18c7cb9b487147ac320c86fa8..83090c3bc9a85bbb8cac0dd4269c3045eff60f9c 100644 (file)
@@ -32,7 +32,6 @@
 typedef struct _php_mb_encoding_handler_info_t {
        int data_type;
        const char *separator;
-       unsigned int force_register_globals: 1;
        unsigned int report_errors: 1;
        enum mbfl_no_language to_language;
        enum mbfl_no_encoding to_encoding;
index 32dbe8ac82e857be0b7f2228a539c74d8654738f..d854dc70aaf70f67d822054db4525f0af9f7afb1 100644 (file)
@@ -1401,7 +1401,6 @@ PHP_FUNCTION(mb_parse_str)
 
        info.data_type              = PARSE_STRING;
        info.separator              = PG(arg_separator).input; 
-       info.force_register_globals = (track_vars_array == NULL);
        info.report_errors          = 1;
        info.to_encoding            = MBSTRG(current_internal_encoding);
        info.to_language            = MBSTRG(current_language);
index 8b320b0845252f34354ed9faf8ddb59e07ebbda2..fcfbbd9fe46f51d9e82184d8045caacc0f924e8a 100644 (file)
@@ -4,7 +4,6 @@ mb_parse_str()
 <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
 --INI--
 arg_separator.input=&
-register_globals=0
 --FILE--
 <?php
 $queries = array(
index 51cfb63cb9a69a6ae3f71c7851e83dd30bdcf2ff..44ed44865cd0e3ce5633ac701d59f952ca07feee 100644 (file)
@@ -4,7 +4,6 @@ mb_parse_str() test 2
 <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
 --INI--
 arg_separator.input=&#
-register_globals=0
 --FILE--
 <?php
 $queries = array(
index f2b70d4ed71bee8ac058d08e02513bfa04047181..ac70ff7885d4ffa53383eda3f3ee12300609a72b 100644 (file)
@@ -138,9 +138,6 @@ PHP_FUNCTION(session_save_path);
 PHP_FUNCTION(session_id);
 PHP_FUNCTION(session_regenerate_id);
 PHP_FUNCTION(session_decode);
-PHP_FUNCTION(session_register);
-PHP_FUNCTION(session_unregister);
-PHP_FUNCTION(session_is_registered);
 PHP_FUNCTION(session_encode);
 PHP_FUNCTION(session_start);
 PHP_FUNCTION(session_destroy);
index 0e8f7a3ed1fbeb3466cf6e9efcd07bca4ac6a39a..892d7fb76d30d4308c54c6be5d2a6e6046bd47d7 100644 (file)
@@ -63,9 +63,6 @@ zend_function_entry session_functions[] = {
        PHP_FE(session_id,                NULL)
        PHP_FE(session_regenerate_id,     NULL)
        PHP_FE(session_decode,            NULL)
-       PHP_FE(session_register,          NULL)
-       PHP_FE(session_unregister,        NULL)
-       PHP_FE(session_is_registered,     NULL)
        PHP_FE(session_encode,            NULL)
        PHP_FE(session_start,             NULL)
        PHP_FE(session_destroy,           NULL)
@@ -281,79 +278,17 @@ PHPAPI void php_add_session_var(char *name, size_t namelen TSRMLS_DC)
        
        zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, namelen + 1, 
                        (void *) &sym_track);
+       if (sym_track == NULL) {
+               zval *empty_var;
 
-       /*
-        * Set up a proper reference between $_SESSION["x"] and $x.
-        */
-
-       if (PG(register_globals)) {
-               zval **sym_global = NULL;
-               
-               zend_hash_find(&EG(symbol_table), name, namelen + 1, 
-                               (void *) &sym_global);
-                               
-               if (sym_global == NULL && sym_track == NULL) {
-                       zval *empty_var;
-
-                       ALLOC_INIT_ZVAL(empty_var); /* this sets refcount to 1 */
-                       empty_var->refcount = 0; /* our module does not maintain a ref */
-                       /* The next call will increase refcount by NR_OF_SYM_TABLES==2 */
-                       zend_set_hash_symbol(empty_var, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
-               } else if (sym_global == NULL) {
-                       SEPARATE_ZVAL_IF_NOT_REF(sym_track);
-                       zend_set_hash_symbol(*sym_track, name, namelen, 1, 1, &EG(symbol_table));
-               } else if (sym_track == NULL) {
-                       SEPARATE_ZVAL_IF_NOT_REF(sym_global);
-                       zend_set_hash_symbol(*sym_global, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars)));
-               }
-       } else {
-               if (sym_track == NULL) {
-                       zval *empty_var;
-       
-                       ALLOC_INIT_ZVAL(empty_var);
-                       ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, empty_var, 1, 0);
-               }
+               ALLOC_INIT_ZVAL(empty_var);
+               ZEND_SET_SYMBOL_WITH_LENGTH(Z_ARRVAL_P(PS(http_session_vars)), name, namelen+1, empty_var, 1, 0);
        }
 }
 
 PHPAPI void php_set_session_var(char *name, size_t namelen, zval *state_val, php_unserialize_data_t *var_hash TSRMLS_DC)
 {
-       if (PG(register_globals)) {
-               zval **old_symbol;
-               if (zend_hash_find(&EG(symbol_table),name,namelen+1,(void *)&old_symbol) == SUCCESS) { 
-                       
-                       /* 
-                        * A global symbol with the same name exists already. That
-                        * symbol might have been created by other means (e.g. $_GET).
-                        *
-                        * hash_update in zend_set_hash_symbol is not good, because
-                        * it will leave referenced variables (such as local instances
-                        * of a global variable) dangling.
-                        *
-                        * BTW: if you use register_globals references between
-                        * session-vars won't work because of this very reason!
-                        */
-
-                       
-                       REPLACE_ZVAL_VALUE(old_symbol,state_val,1);
-
-                       /*
-                        * The following line will update the reference table used for
-                        * unserialization.  It is optional, because some storage 
-                        * formats may not be able to represent references.
-                        */
-
-                       if (var_hash) {
-                               PHP_VAR_UNSERIALIZE_ZVAL_CHANGED(var_hash,state_val,*old_symbol);
-                       }
-
-                       zend_set_hash_symbol(*old_symbol, name, namelen, 1, 1, Z_ARRVAL_P(PS(http_session_vars)));
-               } else {
-                       zend_set_hash_symbol(state_val, name, namelen, 1, 2, Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
-               }
-       } else IF_SESSION_VARS() {
-               zend_set_hash_symbol(state_val, name, namelen, PZVAL_IS_REF(state_val), 1, Z_ARRVAL_P(PS(http_session_vars)));
-       }
+       zend_set_hash_symbol(state_val, name, namelen, PZVAL_IS_REF(state_val), 1, Z_ARRVAL_P(PS(http_session_vars)));
 }
 
 PHPAPI int php_get_session_var(char *name, size_t namelen, zval ***state_var TSRMLS_DC)
@@ -364,23 +299,6 @@ PHPAPI int php_get_session_var(char *name, size_t namelen, zval ***state_var TSR
                ret = zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), name, 
                                namelen+1, (void **) state_var);
 
-               /*
-                * If register_globals is enabled, and
-                * if there is an entry for the slot in $_SESSION, and
-                * if that entry is still set to NULL, and
-                * if the global var exists, then
-                * we prefer the same key in the global sym table
-                */
-               
-               if (PG(register_globals) && ret == SUCCESS 
-                               && Z_TYPE_PP(*state_var) == IS_NULL) {
-                       zval **tmp;
-
-                       if (zend_hash_find(&EG(symbol_table), name, namelen + 1,
-                                               (void **) &tmp) == SUCCESS) {
-                               *state_var = tmp;
-                       }
-               }
        }
        
        return ret;
@@ -811,7 +729,7 @@ static void php_session_save_current_state(TSRMLS_D)
        int ret = FAILURE;
        
        IF_SESSION_VARS() {
-               if (PS(bug_compat) && !PG(register_globals)) {
+               if (PS(bug_compat)) {
                        HashTable *ht = Z_ARRVAL_P(PS(http_session_vars));
                        HashPosition pos;
                        zval **val;
@@ -829,7 +747,7 @@ static void php_session_save_current_state(TSRMLS_D)
                        }
 
                        if (do_warn && PS(bug_compat_warn)) {
-                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.");
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.");
                        }
                }
 
@@ -1562,90 +1480,6 @@ static void php_register_var(zval** entry TSRMLS_DC)
 }
 /* }}} */
 
-/* {{{ proto bool session_register(mixed var_names [, mixed ...])
-   Adds varname(s) to the list of variables which are freezed at the session end */
-PHP_FUNCTION(session_register)
-{
-       zval  ***args;
-       int      argc = ZEND_NUM_ARGS();
-       int      i;
-
-       if (argc <= 0)
-               RETURN_FALSE
-       else
-               args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0);
-       
-       if (zend_get_parameters_array_ex(argc, args) == FAILURE) {
-               efree(args);
-               WRONG_PARAM_COUNT;
-       }
-
-       if (PS(session_status) == php_session_none || PS(session_status) == php_session_disabled) {
-               php_session_start(TSRMLS_C);
-       }
-       
-       if (PS(session_status) == php_session_disabled) {
-               efree(args);
-               RETURN_FALSE;
-       }
-       
-       for (i = 0; i < argc; i++) {
-               if (Z_TYPE_PP(args[i]) == IS_ARRAY)
-                       SEPARATE_ZVAL(args[i]);
-               php_register_var(args[i] TSRMLS_CC);
-       }       
-       
-       efree(args);
-       
-       RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool session_unregister(string varname)
-   Removes varname from the list of variables which are freezed at the session end */
-PHP_FUNCTION(session_unregister)
-{
-       zval **p_name;
-       int ac = ZEND_NUM_ARGS();
-
-       if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
-               WRONG_PARAM_COUNT;
-       
-       convert_to_string_ex(p_name);
-       
-       PS_DEL_VARL(Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name));
-
-       RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool session_is_registered(string varname)
-   Checks if a variable is registered in session */
-PHP_FUNCTION(session_is_registered)
-{
-       zval **p_name;
-       zval *p_var;
-       int ac = ZEND_NUM_ARGS();
-
-       if (ac != 1 || zend_get_parameters_ex(ac, &p_name) == FAILURE)
-               WRONG_PARAM_COUNT;
-       
-       convert_to_string_ex(p_name);
-       
-       if (PS(session_status) == php_session_none)
-               RETURN_FALSE;
-
-       IF_SESSION_VARS() {
-               if (zend_hash_find(Z_ARRVAL_P(PS(http_session_vars)), 
-                                       Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name)+1, 
-                                       (void **)&p_var) == SUCCESS) {
-                       RETURN_TRUE;
-               }
-       }
-       RETURN_FALSE;
-}
-/* }}} */
-
 /* {{{ proto string session_encode(void)
    Serializes the current setup and returns the serialized representation */
 PHP_FUNCTION(session_encode)
@@ -1725,21 +1559,6 @@ PHP_FUNCTION(session_unset)
        IF_SESSION_VARS() {
                HashTable *ht = Z_ARRVAL_P(PS(http_session_vars));
 
-               if (PG(register_globals)) {
-                       uint str_len;
-                       zstr str;
-                       ulong num_key;
-                       HashPosition pos;
-                       
-                       zend_hash_internal_pointer_reset_ex(ht, &pos);
-
-                       while (zend_hash_get_current_key_ex(ht, &str, &str_len, &num_key, 
-                                               0, &pos) == HASH_KEY_IS_STRING) {
-                               zend_delete_global_variable(str.s, str_len-1 TSRMLS_CC);
-                               zend_hash_move_forward_ex(ht, &pos);
-                       }
-               }
-               
                /* Clean $_SESSION. */
                zend_hash_clean(ht);
        }
index 934987f1c99ba2f1ee6aedf84183e24cb7987e07..790ce6f6c46da634dc89a5ebc5bb26a84bda57f9 100644 (file)
@@ -5,7 +5,6 @@ session object serialization
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.serialize_handler=php
 session.save_handler=files
 --FILE--
@@ -23,12 +22,10 @@ $baz->method();
 
 $arr[3] = new foo;
 $arr[3]->method();
-
-session_register("baz");
-session_register("arr");
-
-print session_encode()."\n";
-
+session_start();
+$_SESSION["baz"] = $baz;
+$_SESSION["arr"] = $arr;
+print session_encode();
 session_destroy();
 --EXPECT--
 baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";s:4:"done";}}
index 9972358e1a1fcbaaee46b55c9cf407081a019d49..42b1e5b1beb793baa17e1e1a84a5c66e4e5b4c0c 100644 (file)
@@ -5,7 +5,6 @@ session object deserialization
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.serialize_handler=php
 session.save_handler=files
 --FILE--
@@ -20,6 +19,8 @@ class foo {
 session_id("abtest");
 session_start();
 session_decode('baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:1;}}');
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
 
 $baz->method();
 $arr[3]->method();
index 2040476bc0e2bd370737e1283287b917d3630251..56507ea866d54ab4883a0a848b096db548341989 100644 (file)
@@ -5,7 +5,6 @@ session_set_save_handler test
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.name=PHPSESSID
 session.serialize_handler=php
 --FILE--
@@ -56,6 +55,8 @@ session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd,
 
 session_id("abtest");
 session_start();
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
 $baz->method();
 $arr[3]->method();
 
@@ -72,10 +73,10 @@ var_dump($arr);
 
 session_destroy();
 ?>
---EXPECT--
+--EXPECTF--
 OPEN: PHPSESSID
 READ: abtest
-object(foo)#2 (2) {
+object(foo)#%d (2) {
   ["bar"]=>
   string(2) "ok"
   ["yes"]=>
@@ -83,7 +84,7 @@ object(foo)#2 (2) {
 }
 array(1) {
   [3]=>
-  object(foo)#3 (2) {
+  object(foo)#%d (2) {
     ["bar"]=>
     string(2) "ok"
     ["yes"]=>
@@ -93,7 +94,7 @@ array(1) {
 WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}}
 OPEN: PHPSESSID
 READ: abtest
-object(foo)#4 (2) {
+object(foo)#%d (2) {
   ["bar"]=>
   string(2) "ok"
   ["yes"]=>
@@ -101,7 +102,7 @@ object(foo)#4 (2) {
 }
 array(1) {
   [3]=>
-  object(foo)#2 (2) {
+  object(foo)#%d (2) {
     ["bar"]=>
     string(2) "ok"
     ["yes"]=>
index 5638376b9d59d310443ade6e4082dd7e85b68b7c..efc7f239d0b03c75b4b300dc10546f44382b92c9 100644 (file)
@@ -5,7 +5,6 @@ custom save handler, multiple session_start()s, complex data structure test.
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.name=PHPSESSID
 session.serialize_handler=php
 --FILE--
@@ -58,6 +57,8 @@ session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd,
 
 session_id("abtest");
 session_start();
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
 $baz->method();
 $arr[3]->method();
 
@@ -68,12 +69,16 @@ session_write_close();
 
 session_set_save_handler(array($hnd, "open"), array($hnd, "close"), array($hnd, "read"), array($hnd, "write"), array($hnd, "destroy"), array($hnd, "gc"));
 session_start();
+$baz = $_SESSION['baz'];
+$arr = $_SESSION['arr'];
+
+
 $baz->method();
 $arr[3]->method();
 
 
 $c = 123;
-session_register("c");
+$_SESSION['c'] = $c;
 var_dump($baz); var_dump($arr); var_dump($c);
 
 session_write_close();
@@ -84,10 +89,10 @@ var_dump($baz); var_dump($arr); var_dump($c);
 
 session_destroy();
 ?>
---EXPECT--
+--EXPECTF--
 OPEN: PHPSESSID
 READ: abtest
-object(foo)#2 (2) {
+object(foo)#%d (2) {
   ["bar"]=>
   string(2) "ok"
   ["yes"]=>
@@ -95,7 +100,7 @@ object(foo)#2 (2) {
 }
 array(1) {
   [3]=>
-  object(foo)#3 (2) {
+  object(foo)#%d (2) {
     ["bar"]=>
     string(2) "ok"
     ["yes"]=>
@@ -106,7 +111,7 @@ WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:2;}arr|a:1:{i:3;O
 CLOSE
 OPEN: PHPSESSID
 READ: abtest
-object(foo)#4 (2) {
+object(foo)#%d (2) {
   ["bar"]=>
   string(2) "ok"
   ["yes"]=>
@@ -114,7 +119,7 @@ object(foo)#4 (2) {
 }
 array(1) {
   [3]=>
-  object(foo)#2 (2) {
+  object(foo)#%d (2) {
     ["bar"]=>
     string(2) "ok"
     ["yes"]=>
@@ -126,7 +131,7 @@ WRITE: abtest, baz|O:3:"foo":2:{s:3:"bar";s:2:"ok";s:3:"yes";i:3;}arr|a:1:{i:3;O
 CLOSE
 OPEN: PHPSESSID
 READ: abtest
-object(foo)#3 (2) {
+object(foo)#%d (2) {
   ["bar"]=>
   string(2) "ok"
   ["yes"]=>
@@ -134,7 +139,7 @@ object(foo)#3 (2) {
 }
 array(1) {
   [3]=>
-  object(foo)#4 (2) {
+  object(foo)#%d (2) {
     ["bar"]=>
     string(2) "ok"
     ["yes"]=>
index e3e18bf9dd3847d8e5845b0bdab6c15d571829f3..5466a30c9f35bd95009d9f23a197a6904ca55717 100644 (file)
@@ -5,7 +5,6 @@ correct instantiation of references between variables in sessions
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.serialize_handler=php
 session.save_handler=files
 --FILE--
@@ -32,15 +31,16 @@ $b = new b($a);
 echo "original values:\n";
 var_dump($a,$b);
 
-session_register("a");
-session_register("b");
-session_write_close();
+$_SESSION['a'] = $a;
+$_SESSION['b'] = $b;
 
-session_unregister("a");
-session_unregister("b");
+session_write_close();
+unset($_SESSION['a']);
+unset($_SESSION['b']);
 
 session_start();
-
+$a = $_SESSION['a'];
+$b = $_SESSION['b'];
 echo "values after session:\n";
 var_dump($a,$b);
 ?>
index 7ed74ea474836646d4c0fa8f1fe0819296c07c88..6d7916cef14f5e3f7d7b93312da8adb62d5f83f8 100644 (file)
@@ -1,12 +1,11 @@
 --TEST--
 bug compatibility: unset($c) with enabled register_globals
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php die('skip');/* RG removed */ ?>
 --INI--
 register_long_arrays=1
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.bug_compat_42=1
 session.serialize_handler=php
 session.save_handler=files
@@ -22,7 +21,8 @@ session_destroy();
 
 ### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
 session_id("abtest");
-session_register("c");
+$_SESSION['c'] = $c;
+
 unset($c);
 $c = 3.14;
 session_write_close();
@@ -31,6 +31,7 @@ unset($c);
 
 ### Phase 3 $HTTP_SESSION_VARS["c"] is set
 session_start();
+$c = $_SESSION['c'];
 var_dump($c);
 var_dump($HTTP_SESSION_VARS);
 unset($c);
@@ -43,6 +44,7 @@ unset($c);
 ### Phase 4 final
 
 session_start();
+$c = $_SESSION['c'];
 var_dump($c);
 var_dump($HTTP_SESSION_VARS);
 
index 0057f2be4420c5d0facd8df2c9020e90b2aaec51..96c46dccf298b06a9026143a5c85f39d457b784d 100644 (file)
@@ -2,13 +2,13 @@
 bug compatibility: global is used albeit register_globals=0
 --SKIPIF--
 <?php include('skipif.inc'); 
+die("skip, no more RG and session_register");
  if (version_compare(PHP_VERSION,"4.2.3-dev", "<")) die("skip this is for PHP >= 4.2.3");
 ?>
 --INI--
 register_long_arrays=1
 session.use_cookies=0
 session.cache_limiter=
-register_globals=0
 session.bug_compat_42=1
 session.bug_compat_warn=1
 track_errors=1
@@ -21,14 +21,14 @@ session.save_handler=files
 --FILE--
 <?php
 session_id("abtest");
-
 ### Phase 1 cleanup
 session_start();
 session_destroy();
 
 ### Phase 2 $HTTP_SESSION_VARS["c"] does not contain any value
 session_id("abtest");
-session_register("c");
+$_SESSION['c'] = NULL;
+$c = $_SESSION['c'];
 var_dump($c);
 unset($c);
 $c = 3.14;
@@ -40,6 +40,7 @@ unset($c);
 
 ### Phase 3 $HTTP_SESSION_VARS["c"] is set
 session_start();
+$c = $_SESSION['c'];
 var_dump($HTTP_SESSION_VARS);
 unset($c);
 $c = 2.78;
@@ -51,6 +52,7 @@ unset($c);
 ### Phase 4 final
 
 session_start();
+$c = $_SESSION['c'];
 var_dump($c);
 var_dump($HTTP_SESSION_VARS);
 
index 044a6f2536eb3d18495c609b84733584e5536882..cd88f79d25abe77d6dbcc5c100014d71c49a7392 100644 (file)
@@ -7,7 +7,6 @@ bug compatibility: global is used albeit register_globals=0
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=0
 session.bug_compat_42=1
 session.bug_compat_warn=0
 --FILE--
index 903b8be3a5e6e49d46869669d51831b3af99ef56..6c3eee1dbb468eb51f3aba6d1e3c19b9d83ca89e 100644 (file)
@@ -6,7 +6,6 @@ unset($_SESSION["name"]); should work with register_globals=off
 register_long_arrays=1
 session.use_cookies=0
 session.cache_limiter=
-register_globals=0
 session.bug_compat_42=1
 session.bug_compat_warn=0
 session.serialize_handler=php
index e1af8ce87f9fced13a31f789fde3aa71d990baf4..9ece4e187ba4428bcd96112bd7bcea8a8b7e240b 100644 (file)
@@ -5,7 +5,6 @@ $session_array = explode(";", session_encode()); should not segfault
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=0
 session.bug_compat_42=1
 session.bug_compat_warn=0
 --FILE--
index 6aaa6bd79751aa1bbc426811f04161c0e9d1ab5a..809ee3fd3d55d4993ddae9c2adbda58564e8ea95 100644 (file)
@@ -5,7 +5,6 @@ session_decode(); should not segfault
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=0
 session.bug_compat_42=1
 session.bug_compat_warn=0
 --FILE--
index a3d33d36022ff23c4f43d98329be549a2065d7f5..d471d1c7957856a1b4db03fbe7169d6f1d2fad53 100644 (file)
@@ -1,11 +1,10 @@
 --TEST--
 registering $_SESSION should not segfault
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php die("skip no more RG or session_register"); ?>
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.bug_compat_42=1
 session.bug_compat_warn=0
 session.serialize_handler=php
index 54ccaeddb70d552cbd44cf197f9cd39a8f187ba2..e67a115604c241898788aa496772db0d8264b7bf 100644 (file)
@@ -5,7 +5,6 @@ redefining SID should not cause warnings
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.bug_compat_42=1
 session.bug_compat_warn=0
 session.serialize_handler=php
index 4c5b14c697d7c8f9977173d48cafcc7ed4bfde56..20273aea71d2594addea9f73bb0dc265c29bb83e 100644 (file)
@@ -6,7 +6,6 @@ a script should not be able to modify session.use_trans_sid
 session.use_trans_sid=1
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.bug_compat_42=1
 session.bug_compat_warn=0
 session.name=PHPSESSID
index 2d819c67627e3514f55391c62479bedb67880a4a..9e8037ac6c6fc544db5b8c51c3101f5d9ccdc412 100644 (file)
@@ -1,11 +1,10 @@
 --TEST--
 serializing references test case using globals
 --SKIPIF--
-<?php include('skipif.inc'); ?>
+<?php die("skip no more RG or session_register");include('skipif.inc'); ?>
 --INI--
 session.use_cookies=0
 session.cache_limiter=
-register_globals=1
 session.serialize_handler=php
 session.save_handler=files
 --FILE--
@@ -25,7 +24,8 @@ class TFoo {
 
 session_id("abtest");
 session_start();
-session_register('o1', 'o2' );
+$_SESSION['o1'] = $o1;
+$_SESSION['o2'] = $o2;
 
 $o1 = new TFoo(42);
 $o2 =& $o1;
index ccad794267fe485e0514a68df0a35ffe33a42ea1..f70974d11971f7692b143cf48cd49ce1a94ef139 100644 (file)
@@ -3,7 +3,6 @@ Bug #24592 (crash when multiple NULL values are being stored)
 --SKIPIF--
 <?php include('skipif.inc'); ?>
 --INI--
-register_globals=0
 html_errors=0
 session.save_handler=files
 --FILE--
index 44e7418cd095820be61ab1d42dde49f53817737e..7990f74359b42123aed9f47dd25d0b13695d1fb9 100644 (file)
@@ -3,7 +3,6 @@ Bug #26862 (ob_flush() before output_reset_rewrite_vars() results in data loss)
 --SKIPIF--
 <?php include('skipif.inc'); ?>
 --INI--
-register_globals=0
 html_errors=0
 session.use_trans_sid=0
 session.save_handler=files
index 1ae58af442a56ead5775a4ee111d0648ab868168..c5b02cc1c59fcb5b9712f556aa7e9131ace70d11 100644 (file)
@@ -381,7 +381,6 @@ PHP_INI_BEGIN()
        STD_PHP_INI_ENTRY("output_buffering",           "0",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateLong,   output_buffering,               php_core_globals,       core_globals)
        STD_PHP_INI_ENTRY("output_handler",                     NULL,           PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateString, output_handler,         php_core_globals,       core_globals)
        STD_PHP_INI_BOOLEAN("register_argc_argv",       "1",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   register_argc_argv,             php_core_globals,       core_globals)
-       STD_PHP_INI_BOOLEAN("register_globals",         "0",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   register_globals,               php_core_globals,       core_globals)
        STD_PHP_INI_BOOLEAN("register_long_arrays",     "1",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   register_long_arrays,   php_core_globals,       core_globals)
        STD_PHP_INI_BOOLEAN("auto_globals_jit",         "1",            PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   auto_globals_jit,       php_core_globals,       core_globals)
 #if PHP_SAFE_MODE
index 582a4722771e0c1d40d347aba2e2da472b73867a..ae14971a6058f576f1b739c45a907c2431d676f2 100644 (file)
@@ -118,7 +118,6 @@ struct _php_core_globals {
 
        zend_bool expose_php;
 
-       zend_bool register_globals;
        zend_bool register_long_arrays;
        zend_bool register_argc_argv;
        zend_bool auto_globals_jit;
index c955787cae0a8beebb9d79217ba48c1278860f2c..5b8fcf48975334bc7c360509bde616fd8a982b0d 100644 (file)
@@ -90,9 +90,8 @@ PHPAPI void php_register_variable_ex(char *var, zval *val, zval *track_vars_arra
        
        if (track_vars_array) {
                symtable1 = Z_ARRVAL_P(track_vars_array);
-       } else if (PG(register_globals)) {
-               symtable1 = EG(active_symbol_table);
        }
+
        if (!symtable1) {
                /* Nothing to do */
                zval_dtor(val);
@@ -253,9 +252,8 @@ PHPAPI void php_u_register_variable_ex(UChar *var, zval *val, zval *track_vars_a
 
        if (track_vars_array) {
                symtable1 = Z_ARRVAL_P(track_vars_array);
-       } else if (PG(register_globals)) {
-               symtable1 = EG(active_symbol_table);
        }
+
        if (!symtable1) {
                /* Nothing to do */
                zval_dtor(val);
@@ -669,8 +667,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
        int count = 0;
        char *ss, *space;
        
-       if (! (PG(register_globals) || SG(request_info).argc ||
-                  PG(http_globals)[TRACK_VARS_SERVER]) ) {
+       if (! (SG(request_info).argc || PG(http_globals)[TRACK_VARS_SERVER]) ) {
                return;
        }
        
@@ -727,7 +724,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC)
        argc->is_ref = 0;
        argc->refcount = 0;
 
-       if (PG(register_globals) || SG(request_info).argc) {
+       if (SG(request_info).argc) {
                arr->refcount++;
                argc->refcount++;
                zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL);
@@ -812,7 +809,6 @@ static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
        ulong num_key;
        HashPosition pos;
        int key_type;
-       int globals_check = (PG(register_globals) && (dest == (&EG(symbol_table))));
 
        zend_hash_internal_pointer_reset_ex(src, &pos);
        while (zend_hash_get_current_data_ex(src, (void **)&src_entry, &pos) == SUCCESS) {
@@ -826,7 +822,7 @@ static void php_autoglobal_merge(HashTable *dest, HashTable *src TSRMLS_DC)
                        (*src_entry)->refcount++;
                        if (key_type == HASH_KEY_IS_STRING) {
                                /* if register_globals is on and working with main symbol table, prevent overwriting of GLOBALS */
-                               if (!globals_check || string_key_len != sizeof("GLOBALS") || memcmp(string_key.s, "GLOBALS", sizeof("GLOBALS") - 1)) {
+                               if (string_key_len != sizeof("GLOBALS") || memcmp(string_key.s, "GLOBALS", sizeof("GLOBALS") - 1)) {
                                        zend_u_hash_update(dest, key_type, string_key, string_key_len, src_entry, sizeof(zval *), NULL);
                                } else {
                                        (*src_entry)->refcount--;
@@ -855,7 +851,7 @@ int php_hash_environment(TSRMLS_D)
        unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0};
        zval *dummy_track_vars_array = NULL;
        zend_bool initialized_dummy_track_vars_array=0;
-       zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_globals) && !PG(register_long_arrays) && !PG(register_argc_argv));
+       zend_bool jit_initialization = (PG(auto_globals_jit) && !PG(register_long_arrays) && !PG(register_argc_argv));
        struct auto_global_record {
                char *name;
                uint name_len;
@@ -885,9 +881,6 @@ int php_hash_environment(TSRMLS_D)
                                if (!_gpc_flags[0] && !SG(headers_sent) && SG(request_info).request_method && !strcasecmp(SG(request_info).request_method, "POST")) {
                                        sapi_module.treat_data(PARSE_POST, NULL, NULL TSRMLS_CC);       /* POST Data */
                                        _gpc_flags[0] = 1;
-                                       if (PG(register_globals)) {
-                                               php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST]) TSRMLS_CC);
-                                       }
                                }
                                break;
                        case 'c':
@@ -895,9 +888,6 @@ int php_hash_environment(TSRMLS_D)
                                if (!_gpc_flags[1]) {
                                        sapi_module.treat_data(PARSE_COOKIE, NULL, NULL TSRMLS_CC);     /* Cookie Data */
                                        _gpc_flags[1] = 1;
-                                       if (PG(register_globals)) {
-                                               php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]) TSRMLS_CC);
-                                       }
                                }
                                break;
                        case 'g':
@@ -905,9 +895,6 @@ int php_hash_environment(TSRMLS_D)
                                if (!_gpc_flags[2]) {
                                        sapi_module.treat_data(PARSE_GET, NULL, NULL TSRMLS_CC);        /* GET Data */
                                        _gpc_flags[2] = 1;
-                                       if (PG(register_globals)) {
-                                               php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET]) TSRMLS_CC);
-                                       }
                                }
                                break;
                        case 'e':
@@ -916,9 +903,6 @@ int php_hash_environment(TSRMLS_D)
                                        zend_auto_global_disable_jit("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
                                        php_auto_globals_create_env("_ENV", sizeof("_ENV")-1 TSRMLS_CC);
                                        _gpc_flags[3] = 1;
-                                       if (PG(register_globals)) {
-                                               php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV]) TSRMLS_CC);
-                                       }
                                }
                                break;
                        case 's':
@@ -927,9 +911,6 @@ int php_hash_environment(TSRMLS_D)
                                        zend_auto_global_disable_jit("_SERVER", sizeof("_SERVER")-1 TSRMLS_CC);
                                        php_register_server_variables(TSRMLS_C);
                                        _gpc_flags[4] = 1;
-                                       if (PG(register_globals)) {
-                                               php_autoglobal_merge(&EG(symbol_table), Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]) TSRMLS_CC);
-                                       }
                                }
                                break;
                }
index abdcbd58f6ce831f68058422ecdedec12e92c851..63eb92846d6e414f5f7a5d94b20d4d7271ba2fe6 100644 (file)
@@ -316,41 +316,25 @@ static void safe_u_php_register_variable_ex(UChar *var, zval *val, zval *track_v
 
 static void register_http_post_files_variable(char *strvar, char *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC)
 {
-       int register_globals = PG(register_globals);
-
-       PG(register_globals) = 0;
        safe_php_register_variable(strvar, val, http_post_files, override_protection TSRMLS_CC);
-       PG(register_globals) = register_globals;
 }
 
 
 static void register_u_http_post_files_variable(UChar *strvar, UChar *val, int val_len, zval *http_post_files, zend_bool override_protection TSRMLS_DC)
 {
-       int register_globals = PG(register_globals);
-
-       PG(register_globals) = 0;
        safe_u_php_register_variable(strvar, val, val_len, http_post_files, override_protection TSRMLS_CC);
-       PG(register_globals) = register_globals;
 }
 
 
 static void register_http_post_files_variable_ex(char *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC)
 {
-       int register_globals = PG(register_globals);
-
-       PG(register_globals) = 0;
        safe_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC);
-       PG(register_globals) = register_globals;
 }
 
 
 static void register_u_http_post_files_variable_ex(UChar *var, zval *val, zval *http_post_files, zend_bool override_protection TSRMLS_DC)
 {
-       int register_globals = PG(register_globals);
-
-       PG(register_globals) = 0;
        safe_u_php_register_variable_ex(var, val, http_post_files, override_protection TSRMLS_CC);
-       PG(register_globals) = register_globals;
 }
 
 
index bc4e6f044f717136c7174194787161d697927b2e..f6a5e51ee2049a698518737dadf874891053f9ce 100644 (file)
@@ -388,17 +388,6 @@ track_errors = Off
 ; values override older values.
 variables_order = "EGPCS"
 
-; Whether or not to register the EGPCS variables as global variables.  You may
-; want to turn this off if you don't want to clutter your scripts' global scope
-; with user data.  This makes most sense when coupled with track_vars - in which
-; case you can access all of the GPC variables through the $HTTP_*_VARS[],
-; variables.
-;
-; You should do your best to write your scripts so that they do not require
-; register_globals to be on;  Using form variables as globals can easily lead
-; to possible security problems, if the code is not very well thought of.
-register_globals = Off
-
 ; Whether or not to register the old-style input arrays, HTTP_GET_VARS
 ; and friends.  If you're not using them, it's recommended to turn them off,
 ; for performance reasons.
@@ -412,8 +401,8 @@ register_argc_argv = On
 ; When enabled, the SERVER and ENV variables are created when they're first
 ; used (Just In Time) instead of when the script starts. If these variables
 ; are not used within a script, having this directive on will result in a
-; performance gain. The PHP directives register_globals, register_long_arrays,
-; and register_argc_argv must be disabled for this directive to have any affect.
+; performance gain. The PHP directives  register_long_arrays and 
+; register_argc_argv must be disabled for this directive to have any affect.
 auto_globals_jit = On
 
 ; Maximum size of POST data that PHP will accept.
index d327e1c33a33e9f6b5e1d5924f7cd675c23d08d6..2b51ace1a16d0c77fceb91168ea5f8d66f642d8d 100644 (file)
 ; PHP.  Please make sure you read what's different, and modify your scripts
 ; accordingly, if you decide to use this file instead.
 ;
-; - register_globals = Off         [Security, Performance]
-;     Global variables are no longer registered for input data (POST, GET, cookies,
-;     environment and other server variables).  Instead of using $foo, you must use
-;     you can use $_REQUEST["foo"] (includes any variable that arrives through the
-;     request, namely, POST, GET and cookie variables), or use one of the specific
-;     $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"], depending
-;     on where the input originates.  Also, you can look at the
-;     import_request_variables() function.
-;     Note that register_globals is going to be depracated (i.e., turned off by
-;     default) in the next version of PHP, because it often leads to security bugs.
-;     Read http://php.net/manual/en/security.registerglobals.php for further
-;     information.
 ; - register_long_arrays = Off     [Performance]
 ;     Disables registration of the older (and deprecated) long predefined array
 ;     variables ($HTTP_*_VARS).  Instead, use the superglobals that were
@@ -446,17 +434,6 @@ track_errors = Off
 ; values override older values.
 variables_order = "GPCS"
 
-; Whether or not to register the EGPCS variables as global variables.  You may
-; want to turn this off if you don't want to clutter your scripts' global scope
-; with user data.  This makes most sense when coupled with track_vars - in which
-; case you can access all of the GPC variables through the $HTTP_*_VARS[],
-; variables.
-;
-; You should do your best to write your scripts so that they do not require
-; register_globals to be on;  Using form variables as globals can easily lead
-; to possible security problems, if the code is not very well thought of.
-register_globals = Off
-
 ; Whether or not to register the old-style input arrays, HTTP_GET_VARS
 ; and friends.  If you're not using them, it's recommended to turn them off,
 ; for performance reasons.
@@ -470,8 +447,8 @@ register_argc_argv = Off
 ; When enabled, the SERVER and ENV variables are created when they're first
 ; used (Just In Time) instead of when the script starts. If these variables
 ; are not used within a script, having this directive on will result in a
-; performance gain. The PHP directives register_globals, register_long_arrays,
-; and register_argc_argv must be disabled for this directive to have any affect.
+; performance gain. The PHP directives  register_long_arrays and
+; register_argc_argv must be disabled for this directive to have any affect.
 auto_globals_jit = On
 
 ; Maximum size of POST data that PHP will accept.
@@ -1005,8 +982,8 @@ session.gc_maxlifetime = 1440
 ;          cd /path/to/sessions; find -cmin +24 | xargs rm
 
 ; PHP 4.2 and less have an undocumented feature/bug that allows you to
-; to initialize a session variable in the global scope, albeit register_globals
-; is disabled.  PHP 4.3 and later will warn you, if this feature is used.
+; to initialize a session variable in the global scope.
+; PHP 4.3 and later will warn you, if this feature is used.
 ; You can disable the feature and the warning separately. At this time,
 ; the warning is only displayed, if bug_compat_42 is enabled.
 
index 74042ad7775bc026042d5cc01d682dbbf132bd87..3fe6f0f0b3e37043b18aa2c0cbaaf238352b093f 100644 (file)
@@ -262,9 +262,6 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
        /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
        if (track_vars_array) {
                symbol_table = track_vars_array->value.ht;
-       } else if (PG(register_globals)) {
-               /* should never happen nowadays */
-               symbol_table = EG(active_symbol_table);
        } else {
                symbol_table = NULL;
        }
index 6fb54fcac6f4e446d79ac25778e4db14a60d8bc3..c23dfc1d5ce29a4a1a9f49562c258400e48d8edf 100644 (file)
@@ -384,9 +384,6 @@ static void sapi_apache_register_server_variables(zval *track_vars_array TSRMLS_
        /* If PATH_TRANSLATED doesn't exist, copy it from SCRIPT_FILENAME */
        if (track_vars_array) {
                symbol_table = track_vars_array->value.ht;
-       } else if (PG(register_globals)) {
-               /* should never happen nowadays */
-               symbol_table = EG(active_symbol_table);
        } else {
                symbol_table = NULL;
        }
index dd7f54e28608141935a309da98de7b8b40ae0266..7c9c0e2a2a56b533bdaca2423820a157eac99300 100644 (file)
@@ -79,12 +79,8 @@ int apache_php_module_hook(request_rec *r, php_handler *handler, zval **ret TSRM
     }
 
        req = php_apache_request_new(r);
-    if(PG(register_globals)) {
-        php_register_variable_ex("request", req, NULL TSRMLS_CC);
-    }
-    else {
-        php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
-    }
+       php_register_variable_ex("request", req, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);
+
     switch(handler->type) {
         case AP_HANDLER_TYPE_FILE:
             php_register_variable("PHP_SELF_HOOK", handler->name, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC);