Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SQL query quoting/casting when type is passed to where function
The $type variable can be both string or int, so before comparing it to 'TYPE_CONDITION' string it has to be casted to avoid comparing integer zero with string (0 == 'TYPE_CONDITION') which will wrongly return true, and remove the information about type. Pass type provided to where function down the chain to allow automatic casting of arrays of values e.g. to int. This fixes following cases: 1) ->where('attr_table.store_id IN (?)', $storeIds, Zend_Db::INT_TYPE); 2) ->where('attr_table.store_id = ?', $storeId, Zend_Db::INT_TYPE); In both cases now passed value is correctly casted to int (either single value, or each value from array) Co-authored-by: Ihor Sviziev <ihor-sviziev@users.noreply.github.com>
- Loading branch information