Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Db\Sql\Select.php processJoins quote identifier error #7222

Closed
conyg opened this issue Feb 17, 2015 · 2 comments
Closed

Db\Sql\Select.php processJoins quote identifier error #7222

conyg opened this issue Feb 17, 2015 · 2 comments
Labels
Milestone

Comments

@conyg
Copy link

conyg commented Feb 17, 2015

The processJoins method is calling quoteIdentifierInFragment with an array of safeWords.
In the list of safeWords the AND, OR and BETWEEN should be surrounded by spaces (or whitespaces).
Otherwise the return string may be compromised. Here is an example from SpekCommerce :
input - catalog_category_website.category_id = catalog_category.category_id
output - catalog_category_website.category_id = catalog_category.category_id

the line:
: $platform->quoteIdentifierInFragment($join['on'], array('=', 'AND', 'OR', '(', ')', 'BETWEEN', '<', '>'));
should be replaced by:
: $platform->quoteIdentifierInFragment($join['on'], array('=', ' AND ', ' OR ', '(', ')', ' BETWEEN ', '<', '>'));

@tdroenner
Copy link

I can confirm this bug.

@weierophinney weierophinney added this to the 2.4.0 milestone Feb 25, 2015
andrevus added a commit to andrevus/zf2 that referenced this issue Feb 27, 2015
weierophinney added a commit that referenced this issue Mar 10, 2015
#7222 processJoins quote identifier error fix
weierophinney added a commit that referenced this issue Mar 10, 2015
@weierophinney
Copy link
Member

Fixed with #7275

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

No branches or pull requests

3 participants