登录不支持'-'域名 #2

https://github.com/leanote/leanote-ios/issues/2
This commit is contained in:
life
2015-08-22 00:19:33 +08:00
parent b1046fbd55
commit de9bb00b82

View File

@@ -527,7 +527,8 @@ static NSInteger const LoginVerificationCodeNumberOfLines = 2;
return NO;
}
// http://leanote.com
NSString *urlRegEx = @"(http|https)://((\\w)*|([0-9]*)|([-|_])*)+([:|\\.|/]((\\w)*|([0-9]*)|([-|_])*))+";
// http://www.no-ip.biz
NSString *urlRegEx = @"(http|https)://((\\w)*([0-9]*)|([-|_])*)+\\.([\\w0-9\\-|_\\./:])*";
NSPredicate *urlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", urlRegEx];
return [urlTest evaluateWithObject:url];
// NSURL *siteURL = [NSURL URLWithString:[NSURL IDNEncodedURL:self.siteUrlText.text]];