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:
@ -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
|
||||
|
Reference in New Issue
Block a user