Skip to content

Instantly share code, notes, and snippets.

@fetus-hina
Created June 12, 2013 07:50
Show Gist options
  • Save fetus-hina/5763520 to your computer and use it in GitHub Desktop.
Save fetus-hina/5763520 to your computer and use it in GitHub Desktop.
Zend_Validate_Hostname::decodePunycode() が "-" を含まない Punycode をデコードできない問題
--- Zend/Validate/Hostname.php.b 2013-06-12 16:36:25.000000000 +0900
+++ Zend/Validate/Hostname.php 2013-06-12 16:48:06.000000000 +0900
@@ -705,15 +705,13 @@
return false;
}
+ $decoded = array();
$separator = strrpos($encoded, '-');
if ($separator > 0) {
for ($x = 0; $x < $separator; ++$x) {
// prepare decoding matrix
$decoded[] = ord($encoded[$x]);
}
- } else {
- $this->_error(self::CANNOT_DECODE_PUNYCODE);
- return false;
}
$lengthd = count($decoded);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment