mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +01:00
Merge pull request #694 from GaborApatiNagy/master_CA-173102
CA-173102: Validation issues with address field in connection proxy settings
This commit is contained in:
commit
b756c353f3
@ -49,7 +49,6 @@ namespace XenAdmin.Dialogs.OptionsPages
|
|||||||
private const string ConnectionTabSettingsHeader = "Connection Tab Settings -";
|
private const string ConnectionTabSettingsHeader = "Connection Tab Settings -";
|
||||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private OptionsDialog optionsDialog;
|
private OptionsDialog optionsDialog;
|
||||||
private Regex r = new Regex("[a-zA-Z0-9.]+");
|
|
||||||
|
|
||||||
public ConnectionOptionsPage()
|
public ConnectionOptionsPage()
|
||||||
{
|
{
|
||||||
@ -133,10 +132,10 @@ namespace XenAdmin.Dialogs.OptionsPages
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r.Match(ProxyAddressTextBox.Text).Length != ProxyAddressTextBox.Text.Length || ProxyAddressTextBox.Text == "")
|
var uriHostNameType = Uri.CheckHostName(ProxyAddressTextBox.Text);
|
||||||
optionsDialog.okButton.Enabled = false;
|
|
||||||
else
|
optionsDialog.okButton.Enabled = uriHostNameType != UriHostNameType.Unknown && uriHostNameType != UriHostNameType.IPv6;
|
||||||
optionsDialog.okButton.Enabled = true;
|
return;
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user