fix PHP Deprecated: stripos(): Non-string needles will be interpreted as strings in the future

This commit is contained in:
Ralf Becker 2021-09-18 09:44:46 +02:00
parent 7617aae9d0
commit 3a88aedce1

View File

@ -585,9 +585,9 @@ class Storage extends Storage\Base
$col = $this->table_name .'.'.array_search($col, $this->db_cols).' AS '.$col;
}
// Check to make sure our order by doesn't have aliases that won't work
else if (stripos($col, 'AS') !== false && $order_by)
else if (stripos($col, ' AS ') !== false && $order_by)
{
list($value, $alias) = explode(' AS ', $col);
list($value, $alias) = preg_split('/ AS /i', $col);
if(stripos($order_by, $alias) !== FALSE && stripos($value, $this->table_name) === FALSE)
{
$order_by = str_replace($alias, $value, $order_by);