Fix warning about passing null to substr_count

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2021-10-25 14:33:19 +02:00
parent 9d170f1269
commit ee7ef77808
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -1363,7 +1363,7 @@ class DefaultShareProvider implements IShareProvider {
$best = [];
$bestDepth = 0;
foreach ($shares as $id => $share) {
$depth = substr_count($share['file_target'], '/');
$depth = substr_count(($share['file_target'] ?? ''), '/');
if (empty($best) || $depth < $bestDepth) {
$bestDepth = $depth;
$best = [