From 699e1232ababcd449df33ac54789a0c67a53643e Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Fri, 28 Oct 2011 12:25:41 +0200 Subject: [PATCH] Allow any, but the first two arguments to be optional. --- twig.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/twig.c b/twig.c index 8084dac..9b5735f 100644 --- a/twig.c +++ b/twig.c @@ -695,7 +695,7 @@ PHP_FUNCTION(twig_template_get_attributes) zval *template; zval *object; zval *item; - zval *arguments; + zval *arguments = NULL; zval *ret = NULL; char *type = NULL; int type_len = 0; @@ -703,10 +703,14 @@ PHP_FUNCTION(twig_template_get_attributes) zend_bool ignoreStrictCheck = 0; int free_ret = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ozzasbb", &template, &object, &item, &arguments, &type, &type_len, &isDefinedTest, &ignoreStrictCheck) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ozz|asbb", &template, &object, &item, &arguments, &type, &type_len, &isDefinedTest, &ignoreStrictCheck) == FAILURE) { return; } + if (!type) { + type = "any"; + } + /* // array if (Twig_TemplateInterface::METHOD_CALL !== $type) { -- 1.7.2.5