kalle Wed, 21 Apr 2010 22:23:55 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=298278
Log:
Removed import_request_variables(), this is not needed anymore without
register_globals
Changed paths:
U php/php-src/trunk/NEWS
U php/php-src/trunk/Zend/tests/unset_cv07.phpt
U php/php-src/trunk/ext/standard/basic_functions.c
U php/php-src/trunk/ext/standard/basic_functions.h
U
php/php-src/trunk/ext/standard/tests/general_functions/import_request.phpt
U
php/php-src/trunk/ext/standard/tests/general_functions/import_request1.phpt
U
php/php-src/trunk/ext/standard/tests/general_functions/import_request2.phpt
U
php/php-src/trunk/ext/standard/tests/general_functions/import_request3.phpt
Modified: php/php-src/trunk/NEWS
===================================================================
--- php/php-src/trunk/NEWS 2010-04-21 22:22:31 UTC (rev 298277)
+++ php/php-src/trunk/NEWS 2010-04-21 22:23:55 UTC (rev 298278)
@@ -32,6 +32,7 @@
- Removed legacy features: (Kalle)
. define_syslog_variables ini option and its associated function.
. highlight.bg ini option.
+ . import_request_variables().
. register_globals.
. register_long_arrays ini option.
. y2k_compliance ini option.
Modified: php/php-src/trunk/Zend/tests/unset_cv07.phpt
===================================================================
--- php/php-src/trunk/Zend/tests/unset_cv07.phpt 2010-04-21 22:22:31 UTC
(rev 298277)
+++ php/php-src/trunk/Zend/tests/unset_cv07.phpt 2010-04-21 22:23:55 UTC
(rev 298278)
@@ -1,5 +1,7 @@
--TEST--
unset() CV 7 (indirect unset() of global variable in
import_request_variables())
+--SKIPIF--
+<?php if(PHP_VERSION_ID < 503099){ die('Not needed anymore without
register_globals'); } ?>
--GET--
x=2
--FILE--
Modified: php/php-src/trunk/ext/standard/basic_functions.c
===================================================================
--- php/php-src/trunk/ext/standard/basic_functions.c 2010-04-21 22:22:31 UTC
(rev 298277)
+++ php/php-src/trunk/ext/standard/basic_functions.c 2010-04-21 22:23:55 UTC
(rev 298278)
@@ -855,11 +855,6 @@
ZEND_BEGIN_ARG_INFO(arginfo_config_get_hash, 0)
ZEND_END_ARG_INFO()
#endif
-
-ZEND_BEGIN_ARG_INFO_EX(arginfo_import_request_variables, 0, 0, 1)
- ZEND_ARG_INFO(0, types)
- ZEND_ARG_INFO(0, prefix)
-ZEND_END_ARG_INFO()
#ifdef HAVE_GETLOADAVG
ZEND_BEGIN_ARG_INFO(arginfo_sys_getloadavg, 0)
@@ -2946,7 +2941,6 @@
PHP_FE(get_magic_quotes_gpc,
arginfo_get_magic_quotes_gpc)
PHP_FE(get_magic_quotes_runtime,
arginfo_get_magic_quotes_runtime)
- PHP_FE(import_request_variables,
arginfo_import_request_variables)
PHP_FE(error_log,
arginfo_error_log)
PHP_FE(error_get_last,
arginfo_error_get_last)
PHP_FE(call_user_func,
arginfo_call_user_func)
@@ -6026,104 +6020,6 @@
/* }}} */
#endif
-static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list
args, zend_hash_key *hash_key) /* {{{ */
-{
- zval *prefix, new_key;
- int prefix_len;
- zval **var = (zval **) pDest;
-
- if (num_args != 1) {
- return 0;
- }
-
- prefix = va_arg(args, zval *);
- prefix_len = Z_STRLEN_P(prefix);
-
- if (!prefix_len && !hash_key->nKeyLength) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric key
detected - possible security hazard");
- return 0;
- }
-
- if (hash_key->nKeyLength) {
- php_prefix_varname(&new_key, prefix, hash_key->arKey,
hash_key->nKeyLength - 1, 0 TSRMLS_CC);
- } else {
- zval num;
-
- ZVAL_LONG(&num, hash_key->h);
- convert_to_string(&num);
- php_prefix_varname(&new_key, prefix, Z_STRVAL(num),
Z_STRLEN(num), 0 TSRMLS_CC);
- zval_dtor(&num);
- }
-
- if (php_varname_check(Z_STRVAL(new_key), Z_STRLEN(new_key), 0
TSRMLS_CC) == FAILURE) {
- zval_dtor(&new_key);
- return 0;
- }
-
- zend_delete_global_variable(Z_STRVAL(new_key), Z_STRLEN(new_key)
TSRMLS_CC);
- ZEND_SET_SYMBOL_WITH_LENGTH(&EG(symbol_table), Z_STRVAL(new_key),
Z_STRLEN(new_key) + 1, *var, Z_REFCOUNT_PP(var) + 1, 0);
-
- zval_dtor(&new_key);
- return 0;
-}
-/* }}} */
-
-/* {{{ proto bool import_request_variables(string types [, string prefix])
- Import GET/POST/Cookie variables into the global scope */
-PHP_FUNCTION(import_request_variables)
-{
- char *types;
- int types_len;
- zval *prefix = NULL;
- char *p;
- zend_bool ok = 0;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &types,
&types_len, &prefix) == FAILURE) {
- return;
- }
-
- if (ZEND_NUM_ARGS() > 1) {
- convert_to_string(prefix);
-
- if (Z_STRLEN_P(prefix) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "No prefix
specified - possible security hazard");
- }
- } else {
- MAKE_STD_ZVAL(prefix);
- ZVAL_EMPTY_STRING(prefix);
- }
-
- for (p = types; p && *p; p++) {
- switch (*p) {
-
- case 'g':
- case 'G':
-
zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_GET])
TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
- ok = 1;
- break;
-
- case 'p':
- case 'P':
-
zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_POST])
TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
-
zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_FILES])
TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
- ok = 1;
- break;
-
- case 'c':
- case 'C':
-
zend_hash_apply_with_arguments(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE])
TSRMLS_CC, (apply_func_args_t) copy_request_variable, 1, prefix);
- ok = 1;
- break;
- }
- }
-
- if (ZEND_NUM_ARGS() < 2) {
- zval_ptr_dtor(&prefix);
- }
- RETURN_BOOL(ok);
-}
-/* }}} */
-
#ifdef HAVE_GETLOADAVG
/* {{{ proto array sys_getloadavg()
*/
Modified: php/php-src/trunk/ext/standard/basic_functions.h
===================================================================
--- php/php-src/trunk/ext/standard/basic_functions.h 2010-04-21 22:22:31 UTC
(rev 298277)
+++ php/php-src/trunk/ext/standard/basic_functions.h 2010-04-21 22:23:55 UTC
(rev 298278)
@@ -74,8 +74,6 @@
PHP_FUNCTION(get_magic_quotes_runtime);
PHP_FUNCTION(get_magic_quotes_gpc);
-PHP_FUNCTION(import_request_variables);
-
PHP_FUNCTION(error_log);
PHP_FUNCTION(error_get_last);
Modified:
php/php-src/trunk/ext/standard/tests/general_functions/import_request.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/import_request.phpt
2010-04-21 22:22:31 UTC (rev 298277)
+++ php/php-src/trunk/ext/standard/tests/general_functions/import_request.phpt
2010-04-21 22:23:55 UTC (rev 298278)
@@ -1,5 +1,7 @@
--TEST--
import_request_variables() tests
+--SKIPIF--
+<?php if(PHP_VERSION_ID < 503099){ die('Not needed anymore without
register_globals'); } ?>
--GET--
a=1&b=heh&c=3&d[]=5&GLOBALS=test&1=hm
--POST--
Modified:
php/php-src/trunk/ext/standard/tests/general_functions/import_request1.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/import_request1.phpt
2010-04-21 22:22:31 UTC (rev 298277)
+++ php/php-src/trunk/ext/standard/tests/general_functions/import_request1.phpt
2010-04-21 22:23:55 UTC (rev 298278)
@@ -1,5 +1,7 @@
--TEST--
import_request_variables() test (overwrite super-globals)
+--SKIPIF--
+<?php if(PHP_VERSION_ID < 503099){ die('Not needed anymore without
register_globals'); } ?>
--GET--
GET=0&POST=1&COOKIE=2&FILES=3&REQUEST=4
--POST--
Modified:
php/php-src/trunk/ext/standard/tests/general_functions/import_request2.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/import_request2.phpt
2010-04-21 22:22:31 UTC (rev 298277)
+++ php/php-src/trunk/ext/standard/tests/general_functions/import_request2.phpt
2010-04-21 22:23:55 UTC (rev 298278)
@@ -1,5 +1,7 @@
--TEST--
import_request_variables() test (numeric keys)
+--SKIPIF--
+<?php if(PHP_VERSION_ID < 503099){ die('Not needed anymore without
register_globals'); } ?>
--GET--
1=0&2=1&3=2&4=3&5=4
--POST--
Modified:
php/php-src/trunk/ext/standard/tests/general_functions/import_request3.phpt
===================================================================
--- php/php-src/trunk/ext/standard/tests/general_functions/import_request3.phpt
2010-04-21 22:22:31 UTC (rev 298277)
+++ php/php-src/trunk/ext/standard/tests/general_functions/import_request3.phpt
2010-04-21 22:23:55 UTC (rev 298278)
@@ -1,5 +1,7 @@
--TEST--
import_request_variables() test (numeric keys, different order)
+--SKIPIF--
+<?php if(PHP_VERSION_ID < 503099){ die('Not needed anymore without
register_globals'); } ?>
--GET--
1=0&2=1&3=2&4=3&5=4
--POST--
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php