Skip to content
This repository

[hotfix/ZF-11796] Zend_Validator_Hostname #469

Closed
wants to merge 1 commit into from

2 participants

Thomas Weidner Matthew Weier O'Phinney
Thomas Weidner
  • added new IDN rules for SI
Matthew Weier O'Phinney

Reviewed, merged, and pushed to master - thanks!

Matthew Weier O'Phinney weierophinney closed this October 06, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 05, 2011
Thomas Weidner [hotfix/ZF-11796] Zend_Validator_Hostname
- added new IDN rules for SI
67a6c2e
This page is out of date. Refresh to see the latest.
4  library/Zend/Validator/Hostname.php
@@ -279,6 +279,10 @@ class Hostname extends AbstractValidator
279 279
         'SA'  => array(1 => '/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'),
280 280
         'SE'  => array(1 => '/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'),
281 281
         'SH'  => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
  282
+        'SI'  => array(
  283
+            1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',
  284
+            2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',
  285
+            3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu'),
282 286
         'SJ'  => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
283 287
         'TH'  => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),
284 288
         'TM'  => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
14  tests/Zend/Validator/HostnameTest.php
@@ -437,4 +437,18 @@ public function testSupportsIpv6AddressesWhichContainHexDigitF()
437 437
         $this->assertTrue($validator->isValid('::FFFF:129.144.52.38'));
438 438
         $this->assertTrue($validator->isValid('2010:836B:4179::836B:4179'));
439 439
     }
  440
+
  441
+    /**
  442
+     * @group ZF-11796
  443
+     */
  444
+    public function testIDNSI()
  445
+    {
  446
+        $validator = new Hostname(Hostname::ALLOW_ALL);
  447
+
  448
+        $this->assertTrue($validator->isValid('Test123.si'));
  449
+        $this->assertTrue($validator->isValid('țest123.si'));
  450
+        $this->assertTrue($validator->isValid('tĕst123.si'));
  451
+        $this->assertTrue($validator->isValid('tàrø.si'));
  452
+        $this->assertFalse($validator->isValid('رات.si'));
  453
+    }
440 454
 }
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.