From 4c1e69a71d036e7b1422adeb60cc45031b86e633 Mon Sep 17 00:00:00 2001 From: Nishant Kumar Date: Thu, 14 Nov 2024 14:42:18 +0530 Subject: [PATCH] Add normalized names check to restricted and discarded events check. --- CleverTapSDK/CTValidator.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CleverTapSDK/CTValidator.m b/CleverTapSDK/CTValidator.m index a5329611..c3c5c070 100644 --- a/CleverTapSDK/CTValidator.m +++ b/CleverTapSDK/CTValidator.m @@ -2,6 +2,7 @@ #import "CTValidationResult.h" #import "CTConstants.h" #import "CTKnownProfileFields.h" +#import "CTUtils.h" static const int kMaxKeyChars = 120; static const int kMaxValueChars = 1024; @@ -231,7 +232,7 @@ + (BOOL)isRestrictedEventName:(NSString *)name { NSArray *restrictedNames = @[@"Notification Sent", @"Notification Viewed", @"Notification Clicked", @"UTM Visited", @"App Launched", @"Stayed", @"App Uninstalled", @"wzrk_d", @"wzrk_fetch", @"SCCampaignOptOut", CLTAP_GEOFENCE_ENTERED_EVENT_NAME, CLTAP_GEOFENCE_EXITED_EVENT_NAME]; for (NSString *x in restrictedNames) - if ([name.lowercaseString isEqualToString:x.lowercaseString]) { + if ([CTUtils areEqualNormalizedName:name andName:x]) { // The event name is restricted CTValidationResult *error = [[CTValidationResult alloc] init]; [error setErrorCode:513]; @@ -244,7 +245,7 @@ + (BOOL)isRestrictedEventName:(NSString *)name { + (BOOL)isDiscaredEventName:(NSString *)name { for (NSString *x in discardedEvents) - if ([name.lowercaseString isEqualToString:x.lowercaseString]) { + if ([CTUtils areEqualNormalizedName:name andName:x]) { // The event name is discarded CTValidationResult *error = [[CTValidationResult alloc] init]; [error setErrorCode:513];