Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit d0587af

Browse files
committed
Merge pull request zendframework#472 from mhujer/322-fix-com-idn-pcre
Prevent the PCRE error: preg_match(): Compilation failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff)
2 parents cd4fbd0 + 91a54c9 commit d0587af

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

library/Zend/Validate/Hostname.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ public function isValid($value)
14841484
// Check each domain part
14851485
$checked = false;
14861486
foreach($regexChars as $regexKey => $regexChar) {
1487-
$status = @preg_match($regexChar, $domainPart);
1487+
$status = preg_match($regexChar, $domainPart);
14881488
if ($status > 0) {
14891489
$length = 63;
14901490
if (array_key_exists(strtoupper($this->_tld), $this->_idnLength)

library/Zend/Validate/Hostname/Com.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@
184184
68 => '/^[\x{A000}-\x{A48F}]{1,63}$/iu',
185185
69 => '/^[\x{A490}-\x{A4CF}]{1,63}$/iu',
186186
70 => '/^[\x{AC00}-\x{D7AF}]{1,63}$/iu',
187-
71 => '/^[\x{D800}-\x{DB7F}]{1,63}$/iu',
188-
72 => '/^[\x{DC00}-\x{DFFF}]{1,63}$/iu',
189187
73 => '/^[\x{F900}-\x{FAFF}]{1,63}$/iu',
190188
74 => '/^[\x{FB00}-\x{FB4F}]{1,63}$/iu',
191189
75 => '/^[\x{FB50}-\x{FDFF}]{1,63}$/iu',

tests/Zend/Validate/HostnameTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,4 @@ public function testVermögensberaterIdns()
527527
$validator = new Zend_Validate_Hostname();
528528
$this->assertTrue($validator->isValid('mysite.vermögensberater'));
529529
}
530-
531-
/**
532-
* @group GH-322
533-
*/
534-
public function testCom()
535-
{
536-
$validator = new Zend_Validate_Hostname();
537-
$this->assertTrue($validator->isValid('example.com'));
538-
}
539530
}

0 commit comments

Comments
 (0)