mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-21 10:38:12 +00:00
(fix) make sure we safely escape all chars
This commit is contained in:
1 parent
b0fcaeef86
commit
340ddf0ae6
3 files changed
+12
-13
No files matched your search
@@ -696,7 +696,7 @@ static Class iCalEventK = nil;
|
||||
if ([title length])
|
||||
[baseWhere
|
||||
addObject: [NSString stringWithFormat: @"c_title isCaseInsensitiveLike: '%%%@%%'",
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"]]];
|
||||
[title asSafeSQLString]]];
|
||||
|
||||
if (component)
|
||||
{
|
||||
@@ -1436,14 +1436,14 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||
if ([filters isEqualToString:@"title_Category_Location"] || [filters isEqualToString:@"entireContent"])
|
||||
{
|
||||
[baseWhere addObject: [NSString stringWithFormat: @"(c_title isCaseInsensitiveLike: '%%%@%%' OR c_category isCaseInsensitiveLike: '%%%@%%' OR c_location isCaseInsensitiveLike: '%%%@%%')",
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"],
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"],
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"]]];
|
||||
[title asSafeSQLString],
|
||||
[title asSafeSQLString],
|
||||
[title asSafeSQLString]]];
|
||||
}
|
||||
}
|
||||
else
|
||||
[baseWhere addObject: [NSString stringWithFormat: @"c_title isCaseInsensitiveLike: '%%%@%%'",
|
||||
[title stringByReplacingString: @"'" withString: @"\\'\\'"]]];
|
||||
[title asSafeSQLString]]];
|
||||
}
|
||||
|
||||
/* prepare mandatory fields */
|
||||
@@ -2619,7 +2619,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||
if (uid && folder)
|
||||
{
|
||||
qualifier = [EOQualifier qualifierWithQualifierFormat: @"c_uid = %@",
|
||||
uid];
|
||||
[uid asSafeSQLString]];
|
||||
records = [folder fetchFields: nameFields matchingQualifier: qualifier];
|
||||
count = [records count];
|
||||
if (count)
|
||||
|
||||
Reference in new issue
Block a user