Summary: | can't copy/move files to an album name that contains an apostrophe | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | carlos demaine <carlos> |
Component: | Database-Albums | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 0.7.0 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 8.0.0 | |
Sentry Crash Report: |
Description
carlos demaine
2004-09-19 08:18:20 UTC
CVS commit by pahlibar: sloppy programming. forgot to escape the urls/filenames for the database query. CCMAIL: 89798-done@bugs.kde.org M +11 -11 digikamio.cpp 1.4 --- kdeextragear-3/digikam/kioslave/digikamio.cpp #1.3:1.4 @@ -332,5 +332,5 @@ void kio_digikamioProtocol::copyInternal execSql( QString("SELECT id FROM Albums WHERE url = '%1'") - .arg(oldParentURL), &vals ); + .arg(escapeString(oldParentURL)), &vals ); if (vals.isEmpty()) { @@ -345,5 +345,5 @@ void kio_digikamioProtocol::copyInternal vals.clear(); execSql( QString("SELECT id FROM Albums WHERE url = '%1'") - .arg(newParentURL), &vals ); + .arg(escapeString(newParentURL)), &vals ); if (vals.isEmpty()) { @@ -536,6 +536,6 @@ void kio_digikamioProtocol::rename(const // update album url execSql( QString("UPDATE Albums SET url = '%1' WHERE url = '%2';") - .arg(newURL) - .arg(oldURL) ); + .arg(escapeString(newURL)) + .arg(escapeString(oldURL)) ); // Now rename all the subalbums @@ -544,5 +544,5 @@ void kio_digikamioProtocol::rename(const execSql( QString("SELECT url FROM Albums WHERE url LIKE '%1/%'") - .arg(oldURL), &suburls ); + .arg(escapeString(oldURL)), &suburls ); for (QStringList::iterator it = suburls.begin(); it != suburls.end(); ++it) @@ -556,9 +556,9 @@ void kio_digikamioProtocol::rename(const // delete any stale albums left behind execSql( QString("DELETE FROM Albums WHERE url = '%1'") - .arg(url) ); + .arg(escapeString(url)) ); // update album url execSql( QString("UPDATE Albums SET url = '%1' WHERE url = '%2';") - .arg(url) + .arg(escapeString(url)) .arg(escapeString(*it)) ); } @@ -613,5 +613,5 @@ void kio_digikamioProtocol::rename(const execSql( QString("SELECT id FROM Albums WHERE url = '%1'") - .arg(oldParentURL), &vals ); + .arg(escapeString(oldParentURL)), &vals ); if (vals.isEmpty()) { @@ -626,5 +626,5 @@ void kio_digikamioProtocol::rename(const vals.clear(); execSql( QString("SELECT id FROM Albums WHERE url = '%1'") - .arg(newParentURL), &vals ); + .arg(escapeString(newParentURL)), &vals ); if (vals.isEmpty()) { @@ -729,5 +729,5 @@ void kio_digikamioProtocol::del(const KU execSql( QString("SELECT id FROM Albums WHERE url = '%1'") - .arg(parentURL), &vals ); + .arg(escapeString(parentURL)), &vals ); if (vals.isEmpty()) { @@ -840,5 +840,5 @@ void kio_digikamioProtocol::removeDirFro { execSql( QString("DELETE FROM Albums WHERE url = '%1'") - .arg(url) ); + .arg(escapeString(url)) ); } |