Skip to content

Commit

Permalink
fix pattern variable
Browse files Browse the repository at this point in the history
  • Loading branch information
noogen committed May 10, 2022
1 parent ab85feb commit 3334854
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/RequestQueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,9 @@ public function applyRequestColumns(Request $request)
if (isset($sel)) {
// do not allow caps in column name
$sel = mb_strtolower($sel);
$pattern = '/[^a-z0-9_\*]+/i';
$cols = collect(explode(',', $sel))->map(function ($col) {
// sanitize column name
return trim(preg_replace($pattern, '', $col));
return trim(preg_replace('/[^a-z0-9_\*]+/i', '', $col));
})->filter(function ($col) {
// only return valid column name
return strlen($col) > 0;
Expand Down

0 comments on commit 3334854

Please sign in to comment.