Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[hotfix/ZF-11796] Zend_Validator_Hostname #469

Closed
wants to merge 1 commit into from

2 participants

@thomasweidner
  • added new IDN rules for SI
@weierophinney

Reviewed, merged, and pushed to master - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 5, 2011
  1. @thomasweidner

    [hotfix/ZF-11796] Zend_Validator_Hostname

    thomasweidner authored
    - added new IDN rules for SI
This page is out of date. Refresh to see the latest.
View
4 library/Zend/Validator/Hostname.php
@@ -279,6 +279,10 @@ class Hostname extends AbstractValidator
'SA' => array(1 => '/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'),
'SE' => array(1 => '/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'),
'SH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
+ 'SI' => array(
+ 1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu'),
'SJ' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
'TH' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),
'TM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
View
14 tests/Zend/Validator/HostnameTest.php
@@ -437,4 +437,18 @@ public function testSupportsIpv6AddressesWhichContainHexDigitF()
$this->assertTrue($validator->isValid('::FFFF:129.144.52.38'));
$this->assertTrue($validator->isValid('2010:836B:4179::836B:4179'));
}
+
+ /**
+ * @group ZF-11796
+ */
+ public function testIDNSI()
+ {
+ $validator = new Hostname(Hostname::ALLOW_ALL);
+
+ $this->assertTrue($validator->isValid('Test123.si'));
+ $this->assertTrue($validator->isValid('țest123.si'));
+ $this->assertTrue($validator->isValid('tĕst123.si'));
+ $this->assertTrue($validator->isValid('tàrø.si'));
+ $this->assertFalse($validator->isValid('رات.si'));
+ }
}
Something went wrong with that request. Please try again.