Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 authored and github-actions[bot] committed Dec 10, 2024
1 parent ef1c3cc commit 18a62d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ private function optimizedConcatNotLike(string $fullpath, bool $onlyChildren = f
$leaf = array_pop($pathParts);
$path = implode('/', $pathParts);

if ($onlyChildren){
if ($onlyChildren) {
return '`path` NOT LIKE "' . $fullpath . '/%"';
}

Expand Down Expand Up @@ -979,20 +979,20 @@ protected function getPermittedPathsByUser(string $type, User $user): string
$exceptions = '';
if ($allowedPaths) {
$exceptionsConcat = '';
foreach ($allowedPaths as $path){
foreach ($allowedPaths as $path) {
if ($exceptionsConcat !== '') {
$exceptionsConcat.= ' OR ';
}
$exceptionsConcat.= $this->optimizedConcatLike($path);
}
$exceptions = " OR (" . $exceptionsConcat . ")";
$exceptions = ' OR (' . $exceptionsConcat . ')';
//if any allowed child is found, the current folder can be listed but its content is still blocked
$onlyChildren = true;
}
$forbiddenPathSql[] = $this->optimizedConcatNotLike($forbiddenPath, $onlyChildren) . $exceptions;
}
foreach ($elementPaths['allowed'] as $allowedPaths) {
$allowedPathSql[] = $this->optimizedConcatLike($allowedPaths );
$allowedPathSql[] = $this->optimizedConcatLike($allowedPaths);
}

// this is to avoid query error when implode is empty.
Expand Down

0 comments on commit 18a62d3

Please sign in to comment.