Skip to content

Commit

Permalink
* is a valid field for select
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfui committed Jan 16, 2025
1 parent 4823298 commit d4f7e4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/PHPFUI/ORM/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,16 @@ public static function capitalSplit(string $key) : string

public function cleanField(string $fieldName) : string
{
// Remove invalid characters (replace with space) but allow . for fully specified fields
$sanitized = \preg_replace('/[^a-zA-Z0-9_$.]/', '', $fieldName);
// Remove invalid characters (replace with space) but allow * and . for fully specified fields
$sanitized = \preg_replace('/[^a-zA-Z0-9_$.*]/', '', $fieldName);

// Remove leading/trailing underscores
$sanitized = \trim($sanitized, '_');

// If the string is empty after sanitization, use field
// If the string is empty after sanitization, use *
if (! \strlen($sanitized))
{
$sanitized = 'field';
$sanitized = '*';
}

return $sanitized;
Expand Down

0 comments on commit d4f7e4f

Please sign in to comment.