]> granicus.if.org Git - php/commitdiff
- Fixed bug #70678 (PHP7 returns true when false is expected)
authorFelipe Pena <felipensp@gmail.com>
Sun, 11 Oct 2015 15:08:34 +0000 (12:08 -0300)
committerFelipe Pena <felipensp@gmail.com>
Sun, 11 Oct 2015 15:08:34 +0000 (12:08 -0300)
ext/xsl/xsltprocessor.c

index ffd05522636b371b8d58cdea8860a1ea7d042a04..acba075340f259fab5e65525b511d60cb112255e 100644 (file)
@@ -351,7 +351,7 @@ static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, int t
                                nodep = dom_object_get_node(obj);
                                valuePush(ctxt, xmlXPathNewNodeSet(nodep));
                        } else if (Z_TYPE(retval) == IS_TRUE || Z_TYPE(retval) == IS_FALSE) {
-                               valuePush(ctxt, xmlXPathNewBoolean(Z_LVAL(retval)));
+                               valuePush(ctxt, xmlXPathNewBoolean(Z_TYPE(retval) == IS_TRUE));
                        } else if (Z_TYPE(retval) == IS_OBJECT) {
                                php_error_docref(NULL, E_WARNING, "A PHP Object cannot be converted to a XPath-string");
                                valuePush(ctxt, xmlXPathNewString((const xmlChar *) ""));