summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/execute.c b/execute.c
index aa37fb9..9c078f7 100644
--- a/execute.c
+++ b/execute.c
@@ -859,11 +859,7 @@ int ih_mail(IH_HANDLER_PARAMS)
859 859
860int ih_querycheck(IH_HANDLER_PARAMS) 860int ih_querycheck(IH_HANDLER_PARAMS)
861{ 861{
862#ifdef PHP_ATLEAST_5_3 862 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
863 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
864#else
865 void **p = EG(argument_stack).top_element-2;
866#endif
867 unsigned long arg_count; 863 unsigned long arg_count;
868 zval **arg; 864 zval **arg;
869 char *query, *s, *e; 865 char *query, *s, *e;
@@ -1020,11 +1016,7 @@ int ih_querycheck(IH_HANDLER_PARAMS)
1020 1016
1021int ih_fixusername(IH_HANDLER_PARAMS) 1017int ih_fixusername(IH_HANDLER_PARAMS)
1022{ 1018{
1023#ifdef PHP_ATLEAST_5_3 1019 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
1024 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
1025#else
1026 void **p = EG(argument_stack).top_element-2;
1027#endif
1028 unsigned long arg_count; 1020 unsigned long arg_count;
1029 zval **arg; 1021 zval **arg;
1030 char *prefix, *postfix, *user, *user_match, *cp; 1022 char *prefix, *postfix, *user, *user_match, *cp;
@@ -1115,15 +1107,12 @@ int ih_fixusername(IH_HANDLER_PARAMS)
1115 1107
1116static int ih_function_exists(IH_HANDLER_PARAMS) 1108static int ih_function_exists(IH_HANDLER_PARAMS)
1117{ 1109{
1118#ifndef PHP_ATLEAST_5_3
1119 zval **function_name; 1110 zval **function_name;
1120#endif
1121 zend_function *func; 1111 zend_function *func;
1122 char *lcname; 1112 char *lcname;
1123 zend_bool retval; 1113 zend_bool retval;
1124 int func_name_len; 1114 int func_name_len;
1125 1115
1126#ifndef PHP_ATLEAST_5_3
1127 if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) { 1116 if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &function_name)==FAILURE) {
1128 ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(1); 1117 ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(1);
1129 } 1118 }
@@ -1131,18 +1120,6 @@ static int ih_function_exists(IH_HANDLER_PARAMS)
1131 func_name_len = Z_STRLEN_PP(function_name); 1120 func_name_len = Z_STRLEN_PP(function_name);
1132 lcname = estrndup(Z_STRVAL_PP(function_name), func_name_len); 1121 lcname = estrndup(Z_STRVAL_PP(function_name), func_name_len);
1133 zend_str_tolower(lcname, func_name_len); 1122 zend_str_tolower(lcname, func_name_len);
1134#else
1135 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &lcname, &func_name_len) == FAILURE) {
1136 return (1);
1137 }
1138
1139 /* Ignore leading "\" */
1140 if (func_name_len > 0 && lcname[0] == '\\') {
1141 lcname = &lcname[1];
1142 func_name_len--;
1143 }
1144 lcname = zend_str_tolower_dup(lcname, func_name_len);
1145#endif
1146 1123
1147 retval = (zend_hash_find(EG(function_table), lcname, func_name_len+1, (void **)&func) == SUCCESS); 1124 retval = (zend_hash_find(EG(function_table), lcname, func_name_len+1, (void **)&func) == SUCCESS);
1148 1125
@@ -1559,17 +1536,9 @@ static int ih_rand(IH_HANDLER_PARAMS)
1559 1536
1560static int ih_getrandmax(IH_HANDLER_PARAMS) 1537static int ih_getrandmax(IH_HANDLER_PARAMS)
1561{ 1538{
1562#ifdef PHP_ATLEAST_5_3
1563 if (zend_parse_parameters_none() == FAILURE) { 1539 if (zend_parse_parameters_none() == FAILURE) {
1564 return(0); 1540 return(0);
1565 } 1541 }
1566#else
1567 int argc = ZEND_NUM_ARGS();
1568
1569 if (argc != 0) {
1570 ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(1);
1571 }
1572#endif
1573 RETVAL_LONG(PHP_MT_RAND_MAX); 1542 RETVAL_LONG(PHP_MT_RAND_MAX);
1574 return (1); 1543 return (1);
1575} 1544}
@@ -1737,11 +1706,7 @@ static void suhosin_execute_internal(zend_execute_data *execute_data_ptr, int re
1737 1706
1738#if PHP_VERSION_ID < 50500 1707#if PHP_VERSION_ID < 50500
1739#ifdef ZEND_ENGINE_2 1708#ifdef ZEND_ENGINE_2
1740# if PHP_VERSION_ID < 50400
1741 return_value = (*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.u.var)).var.ptr;
1742# else
1743 return_value = (*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.var)).var.ptr; 1709 return_value = (*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.var)).var.ptr;
1744# endif
1745#else 1710#else
1746 return_value = execute_data_ptr->Ts[execute_data_ptr->opline->result.u.var].var.ptr; 1711 return_value = execute_data_ptr->Ts[execute_data_ptr->opline->result.u.var].var.ptr;
1747#endif 1712#endif