Skip to content

Commit

Permalink
Fix faulty slash in condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Dec 16, 2024
1 parent 03484c0 commit bd0130e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Helper/GridHelperService.php
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ private function optimizedConcatLike(string $fullpath): string
return '(
(`path` = "' . $path . '/" AND `key` = "' . $leaf . '")
OR
`path` LIKE "' . $fullpath . '/%"
`path` LIKE "' . $fullpath . '%"
)';
}

Expand Down Expand Up @@ -999,11 +999,11 @@ protected function getPermittedPathsByUser(string $type, User $user): string
// the result would be like `(((path1 OR path2) AND (not_path3 AND not_path4)))`
$forbiddenAndAllowedSql = '(';

if ($allowedPathSql || $forbiddenPathSql) {
if (!empty($allowedPathSql) || !empty($forbiddenPathSql)) {
$forbiddenAndAllowedSql .= '(';
$forbiddenAndAllowedSql .= $allowedPathSql ? '( ' . implode(' OR ', $allowedPathSql) . ' )' : '';

if ($forbiddenPathSql) {
if (!empty($forbiddenPathSql)) {
//if $allowedPathSql "implosion" is present, we need `AND` in between
$forbiddenAndAllowedSql .= $allowedPathSql ? ' AND ' : '';
$forbiddenAndAllowedSql .= implode(' AND ', $forbiddenPathSql);
Expand Down

0 comments on commit bd0130e

Please sign in to comment.