Permalink
Browse files

fix(comments): validate array structure before calling elgg_extract()

This makes sure that params in return value are arrays before proceeding with the hook.
The bugs manifests itself during some of the test
  • Loading branch information...
hypeJunction committed Dec 25, 2015
1 parent 99b6afb commit 1078b65de759c662318f03e90b50ee3e7fdd2bad
Showing with 1 addition and 1 deletion.
  1. +1 −1 engine/lib/comments.php
View
@@ -246,7 +246,7 @@ function _elgg_comments_permissions_override($hook, $type, $return, $params) {
* @access private
*/
function _elgg_comments_notification_email_subject($hook, $type, $returnvalue, $params) {
- if (!is_array($returnvalue)) {
+ if (!is_array($returnvalue) || !is_array($returnvalue['params'])) {
// another hook handler returned a non-array, let's not override it
return;
}

0 comments on commit 1078b65

Please sign in to comment.