CRM-13554 - Improve string validation in the query engine
Backport of https://github.com/civicrm/civicrm-core/pull/1758
Merge pull request #48 from cividesk/CRM-13554

CRM-13554 - Improve string validation in the query engine