Skip to content

Commit

Permalink
Fix issue with callback cache controller hashing Closures (joomla#14057)
Browse files Browse the repository at this point in the history
* Fix issue with callback cache controller hashing Closures

* Wrap in array
  • Loading branch information
mbabker authored and wilsonge committed Feb 14, 2017
1 parent 9bc0f19 commit 73f9aa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libraries/joomla/cache/controller/callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ protected function _makeId($callback, $args)
$callback[0] = $vars;
}

// A Closure can't be serialized, so to generate the ID we'll need to get its hash
if (is_a($callback, 'closure'))
{
$hash = spl_object_hash($callback);

return md5($hash . serialize(array($args)));
}

return md5(serialize(array($callback, $args)));
}
}

0 comments on commit 73f9aa1

Please sign in to comment.