civicrm/civicrm-core — pull request #4166 by hhermsen (2014-09-17 13:34:44+00:00)
Title: Possible multiplication of $fResult in $result

The old structure allowed for possible multiplication of $fResult in $result when a specific $fnSuffix hook was implemented in one module, but not in another.
We only want to add $fResult to $result if $fnName exists, so moved the array_merge() into that if-statement. Furthermore, if $numParams is not case-specified in the switch, at the array_merge(), $fResult could hold the result from a previous module (because in the default case $fResult is not being set), so we have to initialize $fResult to an empty array in the foreach().