mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixes a count() php warning without an api change
Warning: count(): Parameter must be an array or an object that implements Countable in /path/to/vendor/silverstripe/framework/src/Security/Member.php on line 1355
This commit is contained in:
parent
e7abf11225
commit
6b39b25e20
@ -1347,6 +1347,12 @@ class Member extends DataObject
|
||||
*/
|
||||
public static function mapInCMSGroups($groups = null)
|
||||
{
|
||||
|
||||
// non-countable $groups will issue a warning when using count() in PHP 7.2+
|
||||
if (!$groups) {
|
||||
$groups = [];
|
||||
}
|
||||
|
||||
// Check CMS module exists
|
||||
if (!class_exists(LeftAndMain::class)) {
|
||||
return ArrayList::create()->map();
|
||||
|
Loading…
Reference in New Issue
Block a user