Permalink
Browse files

don't modify function name

  • Loading branch information...
1 parent fba7f95 commit 50da1a288107ca82cfd5022c218cfa5dcda3fa6e @arnaud-lb arnaud-lb committed Dec 10, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 ext/twig/twig.c
View
@@ -619,16 +619,20 @@ 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 ) ) {
return 0;
}
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;
}

0 comments on commit 50da1a2

Please sign in to comment.