mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
additional checks before foreach() loop
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47582 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3a47be1430
commit
b5aaa9b1e2
@ -425,7 +425,7 @@ class Permission extends DataObject {
|
|||||||
}
|
}
|
||||||
$allCodes['ADMIN'] = 'Full administrative rights';
|
$allCodes['ADMIN'] = 'Full administrative rights';
|
||||||
|
|
||||||
foreach($classes as $class) {
|
if($classes) foreach($classes as $class) {
|
||||||
$SNG = singleton($class);
|
$SNG = singleton($class);
|
||||||
$someCodes = $SNG->providePermissions();
|
$someCodes = $SNG->providePermissions();
|
||||||
if($someCodes) foreach($someCodes as $k => $v) {
|
if($someCodes) foreach($someCodes as $k => $v) {
|
||||||
@ -435,7 +435,7 @@ class Permission extends DataObject {
|
|||||||
|
|
||||||
$otherPerms = DB::query("SELECT DISTINCT Code From Permission")
|
$otherPerms = DB::query("SELECT DISTINCT Code From Permission")
|
||||||
->column();
|
->column();
|
||||||
foreach($otherPerms as $otherPerm) {
|
if($otherPerms) foreach($otherPerms as $otherPerm) {
|
||||||
if(!array_key_exists($otherPerm, $allCodes))
|
if(!array_key_exists($otherPerm, $allCodes))
|
||||||
$allCodes[$otherPerm] = $otherPerm;
|
$allCodes[$otherPerm] = $otherPerm;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user