BUGFIX: PHP 5.1 requires an array rather than a string for call_user_func() (from r100367)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@105553 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-05-25 03:44:54 +00:00
parent e5eff98e15
commit 5db5bbf9df

View File

@ -997,6 +997,9 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
static function prepopuplate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) { static function prepopuplate_permission_cache($permission = 'CanEditType', $ids, $batchCallback = null) {
if(!$batchCallback) $batchCallback = "SiteTree::can_{$permission}_multiple"; if(!$batchCallback) $batchCallback = "SiteTree::can_{$permission}_multiple";
//PHP 5.1 requires an array rather than a string for the call_user_func function
$batchCallback=explode('::', $batchCallback);
if(is_callable($batchCallback)) { if(is_callable($batchCallback)) {
$permissionValues = call_user_func($batchCallback, $ids, $permissionValues = call_user_func($batchCallback, $ids,
Member::currentUserID(), false); Member::currentUserID(), false);