projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
e133074
)
- Implemented the strtolower function.
author
Derick Rethans
<github@derickrethans.nl>
Wed, 29 Jun 2011 11:42:34 +0000 (12:42 +0100)
committer
Derick Rethans
<github@derickrethans.nl>
Wed, 29 Jun 2011 11:42:34 +0000 (12:42 +0100)
twig.c
patch
|
blob
|
history
diff --git
a/twig.c
b/twig.c
index
e1b3f84
..
6e0dc83
100644
(file)
--- 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)