From 5193b37822269c19a58b86c8a6e1f8e90bd818e6 Mon Sep 17 00:00:00 2001 From: Ben Fuhrmannek Date: Thu, 17 Jul 2014 13:40:39 +0200 Subject: removed redundant implementations of protected varname check --- ex_imp.c | 59 +---------------------------------------------------------- 1 file changed, 1 insertion(+), 58 deletions(-) (limited to 'ex_imp.c') diff --git a/ex_imp.c b/ex_imp.c index 3325e43..40d40e0 100644 --- a/ex_imp.c +++ b/ex_imp.c @@ -443,6 +443,7 @@ PHP_FUNCTION(suhosin_extract) /* }}} */ + #if PHP_VERSION_ID >= 50300 static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) { @@ -478,35 +479,6 @@ static int copy_request_variable(void *pDest TSRMLS_DC, int num_args, va_list ar return 0; } - if (Z_STRVAL(new_key)[0] == 'H') { - if ((strcmp(Z_STRVAL(new_key), "HTTP_GET_VARS")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_POST_VARS")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_POST_FILES")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_ENV_VARS")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_SERVER_VARS")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_SESSION_VARS")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_COOKIE_VARS")==0)|| - (strcmp(Z_STRVAL(new_key), "HTTP_RAW_POST_DATA")==0)) { - zval_dtor(&new_key); - return 0; - } - } else if (Z_STRVAL(new_key)[0] == '_') { - if ((strcmp(Z_STRVAL(new_key), "_COOKIE")==0)|| - (strcmp(Z_STRVAL(new_key), "_ENV")==0)|| - (strcmp(Z_STRVAL(new_key), "_FILES")==0)|| - (strcmp(Z_STRVAL(new_key), "_GET")==0)|| - (strcmp(Z_STRVAL(new_key), "_POST")==0)|| - (strcmp(Z_STRVAL(new_key), "_REQUEST")==0)|| - (strcmp(Z_STRVAL(new_key), "_SESSION")==0)|| - (strcmp(Z_STRVAL(new_key), "_SERVER")==0)) { - zval_dtor(&new_key); - return 0; - } - } else if (strcmp(Z_STRVAL(new_key), "GLOBALS")==0) { - 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); @@ -554,35 +526,6 @@ static int copy_request_variable(void *pDest, int num_args, va_list args, zend_h return 0; } - if (new_key[0] == 'H') { - if ((strcmp(new_key, "HTTP_GET_VARS")==0)|| - (strcmp(new_key, "HTTP_POST_VARS")==0)|| - (strcmp(new_key, "HTTP_POST_FILES")==0)|| - (strcmp(new_key, "HTTP_ENV_VARS")==0)|| - (strcmp(new_key, "HTTP_SERVER_VARS")==0)|| - (strcmp(new_key, "HTTP_SESSION_VARS")==0)|| - (strcmp(new_key, "HTTP_COOKIE_VARS")==0)|| - (strcmp(new_key, "HTTP_RAW_POST_DATA")==0)) { - efree(new_key); - return 0; - } - } else if (new_key[0] == '_') { - if ((strcmp(new_key, "_COOKIE")==0)|| - (strcmp(new_key, "_ENV")==0)|| - (strcmp(new_key, "_FILES")==0)|| - (strcmp(new_key, "_GET")==0)|| - (strcmp(new_key, "_POST")==0)|| - (strcmp(new_key, "_REQUEST")==0)|| - (strcmp(new_key, "_SESSION")==0)|| - (strcmp(new_key, "_SERVER")==0)) { - efree(new_key); - return 0; - } - } else if (strcmp(new_key, "GLOBALS")==0) { - efree(new_key); - return 0; - } - #if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 0) zend_delete_global_variable(new_key, new_key_len-1 TSRMLS_CC); #else -- cgit v1.3