com php-src: Removed check for count() in SXE class: ext/simplexml/simplexml.c
| From: | Dmitry Stogov | Date: | Tue, 05 May 2015 09:57:30 +0000 |
| Subject: | com php-src: Removed check for count() in SXE class: ext/simplexml/simplexml.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86596@lists.php.net to get a copy of this message | ||
Commit: 17e4c628729946a7e9aaa32feb5b6640defe7fe7
Author: Dmitry Stogov <dmitry@zend.com> Tue, 5 May 2015 12:57:30 +0300
Parents: d754be166e78a41e1a258c97c43e3d100d41704a
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=17e4c628729946a7e9aaa32feb5b6640defe7fe7
Log:
Removed check for count() in SXE class
Changed paths:
M ext/simplexml/simplexml.c
Diff:
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index e71fada..a10def1 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -2136,17 +2136,21 @@ static zend_function* php_sxe_find_fptr_count(zend_class_entry *ce)
{
zend_function *fptr_count = NULL;
zend_class_entry *parent = ce;
+ int inherited = 0;
while (parent) {
if (parent == sxe_class_entry) {
break;
}
parent = parent->parent;
+ inherited = 1;
}
- fptr_count = zend_hash_str_find_ptr(&ce->function_table, "count",
sizeof("count") - 1);
- if (fptr_count->common.scope == parent) {
- fptr_count = NULL;
+ if (inherited) {
+ fptr_count = zend_hash_str_find_ptr(&ce->function_table, "count",
sizeof("count") - 1);
+ if (fptr_count->common.scope == parent) {
+ fptr_count = NULL;
+ }
}
return fptr_count;