CRM-15431 - Use cross-compatible method for escaping strings