Merge pull request #1711 from dhensby/pulls/3.4/allowed-children-fix2

FIX Dont attempt to iterate over null in SiteTree::allowedChildren
This commit is contained in:
Loz Calver 2017-01-10 16:46:48 +00:00 committed by GitHub
commit f26ecb2a9c

View File

@ -2695,8 +2695,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
// Otherwise, the class and all its subclasses are allowed.
if(substr($candidate,0,1) == '*') {
$allowedChildren[] = substr($candidate,1);
} else {
$subclasses = ClassInfo::subclassesFor($candidate);
} elseif ($subclasses = ClassInfo::subclassesFor($candidate)) {
foreach($subclasses as $subclass) {
if ($subclass == 'SiteTree_root' || singleton($subclass) instanceof HiddenClass) {
continue;