Vt*: If picklist field contains values '????' and that field is present in a filter, search operation for value '????' on that field will throw database error
Steps to reproduce:
In leads module, under a picklist field add value '????'. Add the field to a filter. Perform search on that field for value ????
A database error will be thrown.
This is due to the fact that the querygenerator does not build parameterized sql, instead concatenates the values. But in the Listview module the Limit statement is added as a parameter. Hence the adodb library is unable to parse the query as it matches for input parameters even for the search value '????'.
Quick fix: make the Limit clause as well with inline values.
https://code.vtiger.com/vtiger/vtigercrm/blob/master/modules/Vtiger/models/ListView.php#L260