From: umherirrender Date: Sun, 5 Aug 2012 20:14:45 +0000 (+0200) Subject: Fix wrong return value in Preprocessor::getChildrenOfType X-Git-Tag: 1.31.0-rc.0~22823^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=91c3d5c6c581dc21adb0db5038626bc526927011;p=lhc%2Fweb%2Fwiklou.git Fix wrong return value in Preprocessor::getChildrenOfType I am not sure, but this looks wrong, because it adds the type to the array and not the child. This method is unused in core and wmf extensions, maybe removing/deprecating is a better idea, but I am not sure, if that is possible. I have only see this possible error, while looking through the preprocessor. Change-Id: I5b7492d455989a8a3e71b5db6d31091b986c502a --- diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 0e202fd61b..9296e3f10f 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -1574,7 +1574,7 @@ class PPNode_Hash_Tree implements PPNode { $children = array(); for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) { if ( isset( $child->name ) && $child->name === $name ) { - $children[] = $name; + $children[] = $child; } } return $children; diff --git a/includes/parser/Preprocessor_HipHop.hphp b/includes/parser/Preprocessor_HipHop.hphp index d7b07162d6..4ef5ca9e4d 100644 --- a/includes/parser/Preprocessor_HipHop.hphp +++ b/includes/parser/Preprocessor_HipHop.hphp @@ -1758,7 +1758,7 @@ class PPNode_HipHop_Tree implements PPNode { $children = array(); for ( $child = $this->firstChild; $child; $child = $child->nextSibling ) { if ( isset( $child->name ) && $child->name === $name ) { - $children[] = $name; + $children[] = $child; } } return $children;