Browse files

Trim whitespaces and newlines in call destination strings

Fixes #85
  • Loading branch information...
1 parent cc3b39c commit e721a12d0f094a399c6746b982e5ed0ce4c3bc13 @eofster committed Nov 3, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 Classes/ActiveAccountViewController.m
View
5 Classes/ActiveAccountViewController.m
@@ -510,7 +510,10 @@ - (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString:(N
[SIPURIFormatter setTelephoneNumberFormatterSplitsLastFourDigits:
[defaults boolForKey:kTelephoneNumberFormatterSplitsLastFourDigits]];
- AKSIPURI *theURI = [SIPURIFormatter SIPURIFromString:editingString];
+ NSCharacterSet *whitespaceCharset = [NSCharacterSet whitespaceAndNewlineCharacterSet];
+ NSString *trimmedString = [editingString stringByTrimmingCharactersInSet:whitespaceCharset];
+
+ AKSIPURI *theURI = [SIPURIFormatter SIPURIFromString:trimmedString];
if (theURI == nil) {
return nil;
}

0 comments on commit e721a12

Please sign in to comment.