From e8d12da98c80bc326991cbe84421bb7ed4ee428c Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 6 Dec 2012 08:39:46 +0700 Subject: [PATCH] Fix empty string comparison --- ext/twig/twig.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ext/twig/twig.c b/ext/twig/twig.c index 1fea683..f871d1e 100644 --- a/ext/twig/twig.c +++ b/ext/twig/twig.c @@ -1030,7 +1030,7 @@ PHP_FUNCTION(twig_template_get_attributes) // ret can be null, if e.g. the called method throws an exception if (ret) { if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) { - if (Z_STRVAL_P(ret) == "") { + if (Z_STRLEN_P(ret) == 0) { free_ret = 1; } else { zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC); -- 1.7.2.5