1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

* Fixed SQL escaping.

This commit is contained in:
Christian Muehlhaeuser 2012-06-16 07:08:57 +02:00
parent 89cd75a2ed
commit 9849a8ee58
2 changed files with 3 additions and 3 deletions

View File

@ -45,9 +45,9 @@ TomahawkSqlQuery::TomahawkSqlQuery( const QSqlDatabase& db )
QString
TomahawkSqlQuery::escape( const QString& identifier, QSqlDriver::IdentifierType type )
TomahawkSqlQuery::escape( QString identifier )
{
return Database::instance()->impl()->database().driver()->escapeIdentifier( identifier, type );
return identifier.replace( "'", "''" );
}

View File

@ -33,7 +33,7 @@ public:
TomahawkSqlQuery();
TomahawkSqlQuery( const QSqlDatabase& db );
static QString escape( const QString& identifier, QSqlDriver::IdentifierType type = QSqlDriver::FieldName );
static QString escape( QString identifier );
bool exec( const QString& query );
bool exec();