nilportugues / php-sql-query-builder

An elegant lightweight and efficient SQL Query Builder with fluid interface SQL syntax supporting bindings and complicated query generation.
http://nilportugues.com
MIT License
417 stars 114 forks source link

hardening columnAlias removal #120

Closed roelfsche closed 3 years ago

roelfsche commented 3 years ago

This fix helps to retain the columnAlias for columns like: SUM(Column1*Column2) as myAlias if build via $objQuery->setFunctionAsColumn('SUM', ['Column1*Column2'], 'myAlias');

So far the alias will be removed because a * is found. Now it also checks if length of columnName == 1

roelfsche commented 3 years ago

Sorry, there is an error in parantheses, I will fix it..