diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Dbx_sqlite/src/dbevents.cpp | 20 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 4 |
2 files changed, 21 insertions, 3 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index c8185fc815..70f3a6e740 100644 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -287,6 +287,13 @@ BOOL CDbxSQLite::EditEvent(MEVENT hDbEvent, const DBEVENTINFO *dbei) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static void str2json(CMStringA &str)
+{
+ str.Replace("\\", "\\\\");
+}
+
int CDbxSQLite::SetEventJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT *dbv)
{
if (hDbEvent == 0)
@@ -310,7 +317,18 @@ int CDbxSQLite::SetEventJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT * break;
case DBVT_ASCIIZ:
case DBVT_UTF8:
- sqlite3_bind_text(stmt, 2, dbv->pszVal, (int)mir_strlen(dbv->pszVal), nullptr);
+ {
+ tmp = dbv->pszVal;
+ str2json(tmp);
+ sqlite3_bind_text(stmt, 2, tmp, tmp.GetLength(), nullptr);
+ }
+ break;
+ case DBVT_WCHAR:
+ {
+ tmp = T2Utf(dbv->pwszVal).get();
+ str2json(tmp);
+ sqlite3_bind_text(stmt, 2, tmp, tmp.GetLength(), nullptr);
+ }
break;
default:
return 2;
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index 0bcb7e8f9b..adaa690f81 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -131,15 +131,15 @@ void ItemData::load(bool bFullLoad) CMStringW wszFileName; DB::FILE_BLOB blob(dbe); if (blob.isOffline()) { - wszFileName = Srmm_GetOfflineFileName(hContact); + wszFileName = blob.getLocalName(); } else { wchar_t buf[MAX_PATH]; CallService(MS_FILE_GETRECEIVEDFILESFOLDERW, hContact, (LPARAM)buf); wszFileName = buf; + wszFileName.Append(blob.getName()); } - wszFileName.Append(blob.getName()); // if a filename contains spaces, URL will be broken if (wszFileName.Find(' ') != -1) { |