From 2078e50de1c4c2e336f1d9000f4fc08b4d7adcab Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 29 Jun 2011 12:42:34 +0100 Subject: [PATCH] - Implemented the strtolower function. --- twig.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/twig.c b/twig.c index e1b3f84..6e0dc83 100644 --- a/twig.c +++ b/twig.c @@ -168,8 +168,16 @@ int TWIG_CALL_BOOLEAN(zval *property, char *functionName) } -char *TWIG_STRTOLOWER(zval *item) +char *TWIG_STRTOLOWER_ZVAL(zval *item) { + char *item_dup; + + if (Z_TYPE_P(item) != IS_STRING) { + return NULL; + } + item_dup = estrndup(Z_STRVAL_P(item), Z_STRLEN_P(item)); + php_strtolower(item_dup, Z_STRLEN_P(item)); + return item_dup; } zval *TWIG_CALL_USER_FUNC_ARRAY(zval *object, char *function, zval *arguments) -- 1.7.2.5