Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 8c0614b

Browse files
author
Jamie Snape
committed
Tweak validation rules for host names
Fixes #93.
1 parent af13c8c commit 8c0614b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

modules/ldap/forms/Admin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function init()
3535
$hostName->setLabel('LDAP Server Name');
3636
$hostName->setRequired(true);
3737
$hostName->addValidator('NotEmpty', true);
38-
$hostName->addValidator('Hostname', true);
38+
$hostName->addValidator('Hostname', true, array('allow' => Zend_Validate_Hostname::ALLOW_ALL, 'tld' => false));
3939

4040
$port = new Zend_Form_Element_Text(LDAP_PORT_KEY);
4141
$port->setLabel('LDAP Server Port');
@@ -48,7 +48,7 @@ public function init()
4848
$backupServer = new Zend_Form_Element_Text(LDAP_BACKUP_SERVER_KEY);
4949
$backupServer->setLabel('Backup Server Name');
5050
$backupServer->addValidator('NotEmpty', true);
51-
$backupServer->addValidator('Hostname', true);
51+
$backupServer->addValidator('Hostname', true, array('allow' => Zend_Validate_Hostname::ALLOW_ALL, 'tld' => false));
5252

5353
$bindRdn = new Zend_Form_Element_Text(LDAP_BIND_RDN_KEY);
5454
$bindRdn->setLabel('Bind DN');

modules/mail/forms/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function init()
6666
$smtpHost = new Zend_Form_Element_Text(MAIL_SMTP_HOST_KEY);
6767
$smtpHost->setLabel('Server name');
6868
$smtpHost->addValidator('NotEmpty', true);
69-
$smtpHost->addValidator('Hostname', true);
69+
$smtpHost->addValidator('Hostname', true, array('allow' => Zend_Validate_Hostname::ALLOW_ALL, 'tld' => false));
7070

7171
$smtpPort = new Zend_Form_Element_Text(MAIL_SMTP_PORT_KEY);
7272
$smtpPort->setLabel('Port');

modules/solr/forms/Admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function init()
3535
$host->setLabel('Solr Host');
3636
$host->setRequired(true);
3737
$host->addValidator('NotEmpty', true);
38-
$host->addValidator('Hostname', true);
38+
$host->addValidator('Hostname', true, array('allow' => Zend_Validate_Hostname::ALLOW_ALL, 'tld' => false));
3939

4040
$port = new Zend_Form_Element_Text(SOLR_PORT_KEY);
4141
$port->setLabel('Solr Port');

0 commit comments

Comments
 (0)