Skip to content

Commit

Permalink
Env: PHP8 - deprecated null second params
Browse files Browse the repository at this point in the history
  • Loading branch information
dasgarner committed Apr 5, 2023
1 parent 2d0321d commit 1d831ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/Controller/Folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,11 @@ private function buildTreeView(\Xibo\Entity\Folder $folder, int $homeFolderId)
$folder->type = 'home';
}

$children = array_filter(explode(',', $folder->children));
if (!empty($folder->children)) {
$children = array_filter(explode(',', $folder->children));
} else {
$children = [];
}
$childrenDetails = [];

foreach ($children as $childId) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Entity/ModulePropertyTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
* Xibo - Digital Signage - https://xibosignage.com
*
* This file is part of Xibo.
*
Expand Down Expand Up @@ -70,7 +70,7 @@ public function getPropertyValues(bool $decorateForOutput = true): array
// TODO: should we cast values to their appropriate field formats.
if ($decorateForOutput) {
// Does this property have library references?
if ($property->allowLibraryRefs) {
if ($property->allowLibraryRefs && !empty($value)) {
// Parse them out and replace for our special syntax.
$matches = [];
preg_match_all('/\[(.*?)\]/', $value, $matches);
Expand Down

0 comments on commit 1d831ec

Please sign in to comment.