Skip to content

Commit

Permalink
Add normalized names check to restricted and discarded events check.
Browse files Browse the repository at this point in the history
  • Loading branch information
nishant-clevertap committed Nov 14, 2024
1 parent db45c6c commit 4c1e69a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CleverTapSDK/CTValidator.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand All @@ -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];
Expand Down

0 comments on commit 4c1e69a

Please sign in to comment.