1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 12:00:09 +02:00

👌 Fix regular expression

This commit is contained in:
2022-05-10 00:43:17 +02:00
parent f7a98b88a7
commit 7c631099b2

View File

@ -108,7 +108,7 @@ class AddProxyVC: NSViewController, NSTextFieldDelegate {
return false
}
if proxy.range(of: #"(http:\/\/|https:\/\/)(.*)(:)(\d*)"#, options: .regularExpression) == nil {
if proxy.range(of: #"(http:\/\/|https:\/\/)(.+)(:)(\d+)$"#, options: .regularExpression) == nil {
textFieldError.isHidden = false
textFieldError.stringValue = "domain_list.add.errors.subject_invalid".localized
return false
@ -134,6 +134,9 @@ class AddProxyVC: NSViewController, NSTextFieldDelegate {
inputDomainName.stringValue = inputDomainName.stringValue
.replacingOccurrences(of: " ", with: "-")
inputProxySubject.stringValue = inputProxySubject.stringValue
.replacingOccurrences(of: " ", with: "-")
buttonCreateProxy.isEnabled = validate(
domain: inputDomainName.stringValue,
proxy: inputProxySubject.stringValue