summaryrefslogtreecommitdiff
path: root/execute.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2015-01-15 17:09:32 +0100
committerBen Fuhrmannek2015-01-15 17:09:32 +0100
commit5335470004c0e97fd5f4d4a2d0371693cb26fccc (patch)
treeb058967648f7069b5f43a1c23a7c7b8f56460959 /execute.c
parent68960966324f4701a1f402e97f17ca7870a317a4 (diff)
removed <5.4 compatibility code
Diffstat (limited to 'execute.c')
-rw-r--r--execute.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/execute.c b/execute.c
index 37abdfd..9c078f7 100644
--- a/execute.c
+++ b/execute.c
@@ -859,12 +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#if 1
864 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
865#else
866 void **p = EG(argument_stack).top_element-2;
867#endif
868 unsigned long arg_count; 863 unsigned long arg_count;
869 zval **arg; 864 zval **arg;
870 char *query, *s, *e; 865 char *query, *s, *e;
@@ -1021,12 +1016,7 @@ int ih_querycheck(IH_HANDLER_PARAMS)
1021 1016
1022int ih_fixusername(IH_HANDLER_PARAMS) 1017int ih_fixusername(IH_HANDLER_PARAMS)
1023{ 1018{
1024// #ifdef PHP_ATLEAST_5_3 1019 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
1025#if 1
1026 void **p = zend_vm_stack_top(TSRMLS_C) - 1;
1027#else
1028 void **p = EG(argument_stack).top_element-2;
1029#endif
1030 unsigned long arg_count; 1020 unsigned long arg_count;
1031 zval **arg; 1021 zval **arg;
1032 char *prefix, *postfix, *user, *user_match, *cp; 1022 char *prefix, *postfix, *user, *user_match, *cp;
@@ -1117,17 +1107,12 @@ int ih_fixusername(IH_HANDLER_PARAMS)
1117 1107
1118static int ih_function_exists(IH_HANDLER_PARAMS) 1108static int ih_function_exists(IH_HANDLER_PARAMS)
1119{ 1109{
1120// #ifndef PHP_ATLEAST_5_3
1121#if 1
1122 zval **function_name; 1110 zval **function_name;
1123#endif
1124 zend_function *func; 1111 zend_function *func;
1125 char *lcname; 1112 char *lcname;
1126 zend_bool retval; 1113 zend_bool retval;
1127 int func_name_len; 1114 int func_name_len;
1128 1115
1129// #ifndef PHP_ATLEAST_5_3
1130#if 1
1131 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) {
1132 ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(1); 1117 ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(1);
1133 } 1118 }
@@ -1135,18 +1120,6 @@ static int ih_function_exists(IH_HANDLER_PARAMS)
1135 func_name_len = Z_STRLEN_PP(function_name); 1120 func_name_len = Z_STRLEN_PP(function_name);
1136 lcname = estrndup(Z_STRVAL_PP(function_name), func_name_len); 1121 lcname = estrndup(Z_STRVAL_PP(function_name), func_name_len);
1137 zend_str_tolower(lcname, func_name_len); 1122 zend_str_tolower(lcname, func_name_len);
1138#else
1139 if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &lcname, &func_name_len) == FAILURE) {
1140 return (1);
1141 }
1142
1143 /* Ignore leading "\" */
1144 if (func_name_len > 0 && lcname[0] == '\\') {
1145 lcname = &lcname[1];
1146 func_name_len--;
1147 }
1148 lcname = zend_str_tolower_dup(lcname, func_name_len);
1149#endif
1150 1123
1151 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);
1152 1125
@@ -1563,18 +1536,9 @@ static int ih_rand(IH_HANDLER_PARAMS)
1563 1536
1564static int ih_getrandmax(IH_HANDLER_PARAMS) 1537static int ih_getrandmax(IH_HANDLER_PARAMS)
1565{ 1538{
1566// #ifdef PHP_ATLEAST_5_3
1567#if 1
1568 if (zend_parse_parameters_none() == FAILURE) { 1539 if (zend_parse_parameters_none() == FAILURE) {
1569 return(0); 1540 return(0);
1570 } 1541 }
1571#else
1572 int argc = ZEND_NUM_ARGS();
1573
1574 if (argc != 0) {
1575 ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(1);
1576 }
1577#endif
1578 RETVAL_LONG(PHP_MT_RAND_MAX); 1542 RETVAL_LONG(PHP_MT_RAND_MAX);
1579 return (1); 1543 return (1);
1580} 1544}
@@ -1742,11 +1706,7 @@ static void suhosin_execute_internal(zend_execute_data *execute_data_ptr, int re
1742 1706
1743#if PHP_VERSION_ID < 50500 1707#if PHP_VERSION_ID < 50500
1744#ifdef ZEND_ENGINE_2 1708#ifdef ZEND_ENGINE_2
1745# if 0 // PHP_VERSION_ID < 50400
1746 return_value = (*(temp_variable *)((char *) execute_data_ptr->Ts + execute_data_ptr->opline->result.u.var)).var.ptr;
1747# else
1748 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;
1749# endif
1750#else 1710#else
1751 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;
1752#endif 1712#endif