diff --git a/composer.json b/composer.json index a4262cb47b..eb687f231e 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "shardj/zf1-future", "description": "Zend Framework 1. The aim is to keep ZF1 working with the latest PHP versions", "type": "library", + "version": "1.23.0", "keywords": [ "framework", "zf1" diff --git a/library/Zend/Date.php b/library/Zend/Date.php index 5672efb0e2..6531519fd9 100644 --- a/library/Zend/Date.php +++ b/library/Zend/Date.php @@ -1918,6 +1918,22 @@ private function _calculate($calc, $date, $part, $locale) // date strings case self::ISO_8601: + + ///////////////////////////////////////////////// + //first validate minimal lengts of given formats + + // do we have enough of a date? minimum is Y-MM-dd + if( strpos($date, '-') !== FALSE && strlen($date) <9) { + require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); + } + + if( strpos($date, '-') === FALSE && strlen($date) <6) { + require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); + } + + // (-)YYYY-MM-dd preg_match('/^(-{0,1}\d{4})-(\d{2})-(\d{2})/', $date, $datematch); // (-)YY-MM-dd @@ -1954,10 +1970,10 @@ private function _calculate($calc, $date, $part, $locale) if (empty($timematch)) { preg_match('/[T,\s]{0,1}(\d{2})(\d{2})/', $tmpdate, $timematch); } - if (empty($datematch) && empty($timematch)) { - require_once 'Zend/Date/Exception.php'; - throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); - } + if (empty($datematch) && empty($timematch)) { + require_once 'Zend/Date/Exception.php'; + throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date); + } if (!empty($timematch)) { $timeMatchCharCount = iconv_strlen($timematch[0], 'UTF-8'); $tmpdate = iconv_substr($tmpdate, diff --git a/library/Zend/Http/Client/Adapter/Test.php b/library/Zend/Http/Client/Adapter/Test.php index 8392be3a7e..4e152c819c 100644 --- a/library/Zend/Http/Client/Adapter/Test.php +++ b/library/Zend/Http/Client/Adapter/Test.php @@ -127,7 +127,6 @@ public function setConfig($config = []) * @param string $host * @param int $port * @param boolean $secure - * @param int $timeout * @throws Zend_Http_Client_Adapter_Exception */ public function connect($host, $port = 80, $secure = false) diff --git a/library/Zend/Validate/File/Extension.php b/library/Zend/Validate/File/Extension.php index ed66d98a6b..ac00c84302 100644 --- a/library/Zend/Validate/File/Extension.php +++ b/library/Zend/Validate/File/Extension.php @@ -121,7 +121,7 @@ public function setCase($case) */ public function getExtension() { - return $this->_extension !== null + return empty($this->_extension) === FALSE ? explode(',', $this->_extension) : []; } @@ -134,7 +134,7 @@ public function getExtension() */ public function setExtension($extension) { - $this->_extension = null; + $this->_extension = ''; $this->addExtension($extension); return $this; } diff --git a/library/Zend/Version.php b/library/Zend/Version.php index 3a5ea83b33..b943955095 100644 --- a/library/Zend/Version.php +++ b/library/Zend/Version.php @@ -32,7 +32,7 @@ final class Zend_Version /** * Zend Framework version identification - see compareVersion() */ - const VERSION = '1.22.0'; + const VERSION = '1.23.0'; /** * The latest stable version Zend Framework available diff --git a/tests/Zend/VersionTest.php b/tests/Zend/VersionTest.php index f88b4c368e..dd6188a585 100644 --- a/tests/Zend/VersionTest.php +++ b/tests/Zend/VersionTest.php @@ -59,7 +59,7 @@ public function testVersionCompare() $expect = -1; // unit test breaks if ZF version > 1.x for ($i = 0; $i <= 1; $i++) { - for ($j = 0; $j <= 22; $j++) { + for ($j = 0; $j <= 99; $j++) { for ($k = 0; $k <= 99; $k++) { foreach (['dev', 'pr', 'PR', 'alpha', 'a1', 'a2', 'beta', 'b1', 'b2', 'RC', 'RC1', 'RC2', 'RC3', '', 'pl1', 'PL1'] as $rel) { $ver = "$i.$j.$k$rel";