MantisBT: master-1.2.x 6a7db340

Author Committer Branch Timestamp Parent
dregad dregad master-1.2.x 2012-08-31 03:38 master-1.2.x b5abce1f
Affected Issues  0012170: SQL syntax error occurs when sorting it by the custom field where special character is included.
 0015264: custom_field_get_id_from_name() broken since 1.2.12
Changeset

Fix SQL error when sorting by custom field containing special char

Incorrect behavior is due to unnecessarily escaping of special chars by
calling db_prepare_string() on the custom field's name before attempting
to retrieve it's id with custom_field_get_id_from_name(). This causes a
double-escaping which prevents a match.

Even though this is not strictly necessary to fix the issue at hand,
this commit also replaces db_query() call by db_query_bound() in
custom_field_get_id_from_name().

Fixes 0012170

mod - core/custom_field_api.php Diff File
mod - core/filter_api.php Diff File