Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EAV attribute condition SQL is not escaped by quoteIdentifier method for the filtered fields #801

Open
kanevbg opened this issue Aug 21, 2019 · 2 comments

Comments

@kanevbg
Copy link
Contributor

kanevbg commented Aug 21, 2019

Eg, it generates attribute aliases without apostrophes:

WHERE (`e`.`attribute_set_id` = '10') AND (at_fmfid.value != '') AND (at_sgid.value != '') AND (at_44-01.value = 200233)

instead of:

WHERE (`e`.`attribute_set_id` = '10') AND (`at_fmfid`.`value` != '') AND (`at_sgid`.`value` != '') AND (`at_44-01`.`value` = 200233)

The second example is the proper and the reliable one according to MySQL syntax.

The bug is on line: app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php:1388

$field = $this->_getAttributeTableAlias($attribute) . '.value';

which should be:
$field = $this->getConnection()->quoteIdentifier($this->_getAttributeTableAlias($attribute) . '.value');

@colinmollenhour
Copy link
Member

Agreed, would you submit a PR, please?

@addison74
Copy link
Contributor

@kanevbg - If this is a bug in OpenMage please submit a PR for being tested. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants