From: Arnaud Le Blanc Date: Sat, 10 Dec 2011 13:48:20 +0000 (+0100) Subject: don't modify function name X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=50da1a288107ca82cfd5022c218cfa5dcda3fa6e;p=web%2Fkonrad%2Ftwig.git don't modify function name --- diff --git a/ext/twig/twig.c b/ext/twig/twig.c index bd51d49..90f87cd 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -619,6 +619,7 @@ static int twig_add_method_to_class(void *pDest TSRMLS_DC, int num_args, va_list { zval *retval; char *item; + size_t item_len; zend_function *mptr = (zend_function *) pDest; if ( ! (mptr->common.fn_flags & ZEND_ACC_PUBLIC ) ) { @@ -626,9 +627,12 @@ static int twig_add_method_to_class(void *pDest TSRMLS_DC, int num_args, va_list } retval = va_arg(args, zval*); - item = php_strtolower(mptr->common.function_name, strlen(mptr->common.function_name)); - add_assoc_string(retval, item, item, 1); + item_len = strlen(mptr->common.function_name); + item = estrndup(mptr->common.function_name, item_len); + php_strtolower(item, item_len); + + add_assoc_stringl_ex(retval, item, item_len+1, item, item_len, 0); return 0; }