Skip to content

Commit

Permalink
Check for query->advanced before using it.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Apr 3, 2024
1 parent dfd6197 commit e98033c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/QueriesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function execute(int $id = 0, object $user = null): array
$type = end($split3);
$sql = str_ireplace('WHERE @filter', "WHERE {$filter}", $sql);
}
if (!empty($instance->config->advanced_queries) and $instance->config->advanced_queries and $query->advanced === 'y') {
if (!empty($instance->config->advanced_queries) and $instance->config->advanced_queries and !empty($query->advanced) and $query->advanced === 'y') {
$sql = str_ireplace('@orgs', "({$user->org_list})", $sql);
}

Expand Down

0 comments on commit e98033c

Please sign in to comment.