mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
sanitize option keys
This commit is contained in:
parent
7572fc2d90
commit
ab58467fc0
|
|
@ -86,14 +86,19 @@ abstract class SettingsAbstract implements OptionsInterface
|
|||
{
|
||||
try {
|
||||
if (!\is_array($columns)) {
|
||||
$columns = [$columns];
|
||||
$keys = [$columns];
|
||||
} else {
|
||||
$keys = [];
|
||||
foreach ($columns as $key) {
|
||||
$keys[] = \is_string($key) ? (int) \preg_replace('/[^0-9.]/', '', $key) : $key;
|
||||
}
|
||||
}
|
||||
|
||||
$options = [];
|
||||
$query = new Builder($this->connection);
|
||||
$sql = $query->select(...static::$columns)
|
||||
->from($this->connection->prefix . static::$table)
|
||||
->where(static::$columns[0], 'in', $columns)
|
||||
->where(static::$columns[0], 'in', $keys)
|
||||
->toSql();
|
||||
|
||||
$sth = $this->connection->con->prepare($sql);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user