com php-src: Fixed bug #70678 (PHP7 returns true when false is expected): ext/xsl/xsltprocessor.c
| From: | Anatol Belski | Date: | Sun, 08 Nov 2015 08:27:41 +0000 |
| Subject: | com php-src: Fixed bug #70678 (PHP7 returns true when false is expected): ext/xsl/xsltprocessor.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89675@lists.php.net to get a copy of this message | ||
Commit: 23e625b3ad293cce4a1fc40a9027a8d9ca95847b
Author: Felipe Pena <felipensp@gmail.com> Sun, 11 Oct 2015 12:08:34 -0300
Committer: Anatol Belski <ab@php.net> Sun, 8 Nov 2015 09:27:41 +0100
Parents: 320afaee323f2f87974d258017d033e50c8db183
Branches: PHP-7.0.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=23e625b3ad293cce4a1fc40a9027a8d9ca95847b
Log:
Fixed bug #70678 (PHP7 returns true when false is expected)
Cherry-pick from master.
Bugs:
https://bugs.php.net/70678
Changed paths:
M ext/xsl/xsltprocessor.c
Diff:
diff --git a/ext/xsl/xsltprocessor.c b/ext/xsl/xsltprocessor.c
index ffd0552..acba075 100644
--- a/ext/xsl/xsltprocessor.c
+++ b/ext/xsl/xsltprocessor.c
@@ -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 *) ""));