diff options
author | RJ Ryan <rryan@mixxx.org> | 2014-11-13 15:30:54 -0500 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2014-11-13 15:33:16 -0500 |
commit | 202c858d4eaee149885c66fd41fedb873a1e6564 (patch) | |
tree | f260bec46a448f487e59c336baf150bb68026d65 /src/library/queryutil.h | |
parent | 058328f439d02c3d5a60c87d98e1f7c4056b4546 (diff) |
Don't double-escape verified directory list (at the expense of escaping twice).
Diffstat (limited to 'src/library/queryutil.h')
-rw-r--r-- | src/library/queryutil.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/library/queryutil.h b/src/library/queryutil.h index 337232adeb..878772fb5e 100644 --- a/src/library/queryutil.h +++ b/src/library/queryutil.h @@ -81,6 +81,19 @@ class FieldEscaper { return m_database.driver()->formatValue(m_stringField); } + QStringList escapeStrings(const QStringList& escapeStrings) const { + QStringList result = escapeStrings; + escapeStringsInPlace(&result); + return result; + } + + void escapeStringsInPlace(QStringList* pEscapeStrings) const { + QMutableStringListIterator it(*pEscapeStrings); + while (it.hasNext()) { + it.setValue(escapeString(it.next())); + } + } + // Escapes a string for use in a LIKE operation by prefixing instances of // LIKE wildcard characters (% and _) with escapeCharacter. This allows the // caller to then attach wildcard characters to the string. This does NOT |