From 0a76a30ca5b2f32af4ca4077a0ab0c35c6503df7 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 13:07:37 +0200 Subject: [PATCH 1/8] version bump --- composer.json | 1 + library/Zend/Version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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/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 From 2e53484719d0d0edb5d9591c54fc446ee66758e2 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 13:08:10 +0200 Subject: [PATCH 2/8] comment fix (#355) --- library/Zend/Http/Client/Adapter/Test.php | 1 - 1 file changed, 1 deletion(-) 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) From 8dce1fab1ab5b18577fa443bf9d822164ec78aad Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 16:18:07 +0200 Subject: [PATCH 3/8] fixed deprecation in comparsion (#351) --- library/Zend/Validate/File/Extension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } From 787c9910d9adfa0fcec35b36f40e1412389233f5 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 16:29:12 +0200 Subject: [PATCH 4/8] fixed Zend version test --- tests/Zend/VersionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; From 14e968d0c073e0e1fb4d05a90735c52f01dd7706 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 20:08:00 +0200 Subject: [PATCH 5/8] fixed Zend_Date::ISO_8601 validation (#339) --- library/Zend/Date.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/library/Zend/Date.php b/library/Zend/Date.php index 5672efb0e2..4794179ee7 100644 --- a/library/Zend/Date.php +++ b/library/Zend/Date.php @@ -1918,6 +1918,13 @@ private function _calculate($calc, $date, $part, $locale) // date strings case self::ISO_8601: + + // do we have enough of a date? minimum is YYMMdd + if( 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 +1961,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, From 8d040e6bc2873a91569b1016e1a1ec88118f55ab Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 20:28:56 +0200 Subject: [PATCH 6/8] fixed Zend_Date::ISO_8601 validation - extended length check (#339) --- library/Zend/Date.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/Zend/Date.php b/library/Zend/Date.php index 4794179ee7..6531519fd9 100644 --- a/library/Zend/Date.php +++ b/library/Zend/Date.php @@ -1919,12 +1919,21 @@ private function _calculate($calc, $date, $part, $locale) // date strings case self::ISO_8601: - // do we have enough of a date? minimum is YYMMdd - if( strlen($date) <6) { + ///////////////////////////////////////////////// + //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 From e41414c2507741dc7ccaefd6c8f5d2043af86ab8 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 20:42:56 +0200 Subject: [PATCH 7/8] fixed PR: Add ForceIndex function to DB Select.php #350 --- library/Zend/Db/Select.php | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/library/Zend/Db/Select.php b/library/Zend/Db/Select.php index 4929cda058..fd2a721a01 100644 --- a/library/Zend/Db/Select.php +++ b/library/Zend/Db/Select.php @@ -47,6 +47,7 @@ class Zend_Db_Select const DISTINCT = 'distinct'; const COLUMNS = 'columns'; const FROM = 'from'; + const FORCE_INDEX = 'forceindex'; const UNION = 'union'; const WHERE = 'where'; const GROUP = 'group'; @@ -73,6 +74,7 @@ class Zend_Db_Select const SQL_UNION = 'UNION'; const SQL_UNION_ALL = 'UNION ALL'; const SQL_FROM = 'FROM'; + const SQL_FORCE_INDEX = 'FORCE INDEX'; const SQL_WHERE = 'WHERE'; const SQL_DISTINCT = 'DISTINCT'; const SQL_GROUP_BY = 'GROUP BY'; @@ -466,6 +468,19 @@ public function joinNatural($name, $cols = self::SQL_WILDCARD, $schema = null) { return $this->_join(self::NATURAL_JOIN, $name, null, $cols, $schema); } + + /** + * Adds an index hint for a given schema.index + * @param $tableIndex + * @throws Zend_Db_Select_Exception + */ + public function forceIndex($tableIndex) + { + list($table,$index) = explode('.',$tableIndex); + if (empty($table) || empty($index)) { + throw new Zend_Db_Select_Exception("Format of forceIndex is table_name.index_name"); + } + } /** * Adds a WHERE condition to the query by AND. @@ -1089,6 +1104,19 @@ protected function _getQuotedTable($tableName, $correlationName = null) { return $this->_adapter->quoteTableAs($tableName, $correlationName, true); } + + /** + * Returns force index statement for _renderFrom processing + * @param $tableName + * @return string + */ + protected function _getForceIndexForTable($tableName) + { + if ($this->_parts[self::FORCE_INDEX][$tableName]) { + return ' ' . self::SQL_FORCE_INDEX . ' ('.$this->_parts[self::FORCE_INDEX][$tableName].')'; + } + return ''; + } /** * Render DISTINCT clause @@ -1168,6 +1196,7 @@ protected function _renderFrom($sql) $tmp .= $this->_getQuotedSchema($table['schema']); $tmp .= $this->_getQuotedTable($table['tableName'], $correlationName); + $tmp .= $this->_getForceIndexForTable($table['tableName']); // Add join conditions (if applicable) if (!empty($from) && ! empty($table['joinCondition'])) { @@ -1185,7 +1214,7 @@ protected function _renderFrom($sql) return $sql; } - + /** * Render UNION query * From 1bc6de3d8260d4149b851c3b8f9ca09afa0bc618 Mon Sep 17 00:00:00 2001 From: DevelArt IV Date: Thu, 10 Aug 2023 20:57:21 +0200 Subject: [PATCH 8/8] reverted: Add ForceIndex function to DB Select.php #350 --- library/Zend/Db/Select.php | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/library/Zend/Db/Select.php b/library/Zend/Db/Select.php index fd2a721a01..4929cda058 100644 --- a/library/Zend/Db/Select.php +++ b/library/Zend/Db/Select.php @@ -47,7 +47,6 @@ class Zend_Db_Select const DISTINCT = 'distinct'; const COLUMNS = 'columns'; const FROM = 'from'; - const FORCE_INDEX = 'forceindex'; const UNION = 'union'; const WHERE = 'where'; const GROUP = 'group'; @@ -74,7 +73,6 @@ class Zend_Db_Select const SQL_UNION = 'UNION'; const SQL_UNION_ALL = 'UNION ALL'; const SQL_FROM = 'FROM'; - const SQL_FORCE_INDEX = 'FORCE INDEX'; const SQL_WHERE = 'WHERE'; const SQL_DISTINCT = 'DISTINCT'; const SQL_GROUP_BY = 'GROUP BY'; @@ -468,19 +466,6 @@ public function joinNatural($name, $cols = self::SQL_WILDCARD, $schema = null) { return $this->_join(self::NATURAL_JOIN, $name, null, $cols, $schema); } - - /** - * Adds an index hint for a given schema.index - * @param $tableIndex - * @throws Zend_Db_Select_Exception - */ - public function forceIndex($tableIndex) - { - list($table,$index) = explode('.',$tableIndex); - if (empty($table) || empty($index)) { - throw new Zend_Db_Select_Exception("Format of forceIndex is table_name.index_name"); - } - } /** * Adds a WHERE condition to the query by AND. @@ -1104,19 +1089,6 @@ protected function _getQuotedTable($tableName, $correlationName = null) { return $this->_adapter->quoteTableAs($tableName, $correlationName, true); } - - /** - * Returns force index statement for _renderFrom processing - * @param $tableName - * @return string - */ - protected function _getForceIndexForTable($tableName) - { - if ($this->_parts[self::FORCE_INDEX][$tableName]) { - return ' ' . self::SQL_FORCE_INDEX . ' ('.$this->_parts[self::FORCE_INDEX][$tableName].')'; - } - return ''; - } /** * Render DISTINCT clause @@ -1196,7 +1168,6 @@ protected function _renderFrom($sql) $tmp .= $this->_getQuotedSchema($table['schema']); $tmp .= $this->_getQuotedTable($table['tableName'], $correlationName); - $tmp .= $this->_getForceIndexForTable($table['tableName']); // Add join conditions (if applicable) if (!empty($from) && ! empty($table['joinCondition'])) { @@ -1214,7 +1185,7 @@ protected function _renderFrom($sql) return $sql; } - + /** * Render UNION query *