From 5dd880b483cf40492eae995e03f3c013b03c5e89 Mon Sep 17 00:00:00 2001 From: Garry Childs Date: Mon, 26 Sep 2022 11:12:54 +0100 Subject: [PATCH 1/4] Removed depreciation message with strtoupper Updated composer.json --- composer.json | 2 +- library/Zend/Form.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 0b8112aa08..bacdd4ead8 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "shardj/zf1-future", + "name": "krytenuk/zf1-future", "description": "Zend Framework 1. The aim is to keep ZF1 working with the latest PHP versions", "type": "library", "keywords": [ diff --git a/library/Zend/Form.php b/library/Zend/Form.php index a1aec831e2..abd545bfae 100644 --- a/library/Zend/Form.php +++ b/library/Zend/Form.php @@ -417,7 +417,7 @@ public function setConfig(Zend_Config $config) */ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type = null) { - $type = strtoupper($type); + $type = $type === null ? null : strtoupper($type); switch ($type) { case self::DECORATOR: case self::ELEMENT: @@ -445,7 +445,7 @@ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $typ */ public function getPluginLoader($type = null) { - $type = strtoupper($type); + $type = $type === null ? null : strtoupper($type); if (!isset($this->_loaders[$type])) { switch ($type) { case self::DECORATOR: @@ -495,7 +495,7 @@ public function getPluginLoader($type = null) */ public function addPrefixPath($prefix, $path, $type = null) { - $type = strtoupper($type); + $type = $type === null ? null : strtoupper($type); switch ($type) { case self::DECORATOR: case self::ELEMENT: From ecb2580d447ad17351290abf2bebc186c4ecb21d Mon Sep 17 00:00:00 2001 From: Garry Childs Date: Tue, 27 Sep 2022 08:32:25 +0100 Subject: [PATCH 2/4] Reverted changes in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bacdd4ead8..0b8112aa08 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "krytenuk/zf1-future", + "name": "shardj/zf1-future", "description": "Zend Framework 1. The aim is to keep ZF1 working with the latest PHP versions", "type": "library", "keywords": [ From 7452eb969d84af093383c6f1266826269a3aaa1a Mon Sep 17 00:00:00 2001 From: Garry Childs Date: Wed, 26 Oct 2022 20:02:44 +0100 Subject: [PATCH 3/4] Updated strtoupper with type cast --- library/Zend/Form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/Zend/Form.php b/library/Zend/Form.php index abd545bfae..4c704a07bb 100644 --- a/library/Zend/Form.php +++ b/library/Zend/Form.php @@ -417,7 +417,7 @@ public function setConfig(Zend_Config $config) */ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type = null) { - $type = $type === null ? null : strtoupper($type); + $type = strtoupper((string) $type); switch ($type) { case self::DECORATOR: case self::ELEMENT: @@ -445,7 +445,7 @@ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $typ */ public function getPluginLoader($type = null) { - $type = $type === null ? null : strtoupper($type); + $type = strtoupper((string) $type); if (!isset($this->_loaders[$type])) { switch ($type) { case self::DECORATOR: @@ -495,7 +495,7 @@ public function getPluginLoader($type = null) */ public function addPrefixPath($prefix, $path, $type = null) { - $type = $type === null ? null : strtoupper($type); + $type = strtoupper((string) $type); switch ($type) { case self::DECORATOR: case self::ELEMENT: From 50c425ef7cb0866eb283ae8eb36a6da8496e294e Mon Sep 17 00:00:00 2001 From: Garry Childs Date: Tue, 7 Feb 2023 15:01:54 +0000 Subject: [PATCH 4/4] Added typecast to stop depreciation messages --- library/Zend/Controller/Router/Route/Module.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/Zend/Controller/Router/Route/Module.php b/library/Zend/Controller/Router/Route/Module.php index 7191a194f4..9b57541ea1 100644 --- a/library/Zend/Controller/Router/Route/Module.php +++ b/library/Zend/Controller/Router/Route/Module.php @@ -258,16 +258,16 @@ public function assemble($data = [], $reset = false, $encode = true, $partial = unset($params[$this->_actionKey]); foreach ($params as $key => $value) { - $key = ($encode) ? urlencode($key) : $key; + $key = ($encode) ? urlencode((string) $key) : $key; if (is_array($value)) { foreach ($value as $arrayValue) { - $arrayValue = ($encode) ? urlencode($arrayValue) : $arrayValue; + $arrayValue = ($encode) ? urlencode((string) $arrayValue) : $arrayValue; $url .= self::URI_DELIMITER . $key; $url .= self::URI_DELIMITER . $arrayValue; } } else { if ($encode && is_string($value)) { - $value = urlencode($value); + $value = urlencode((string) $value); } $url .= self::URI_DELIMITER . $key; $url .= self::URI_DELIMITER . $value; @@ -276,21 +276,21 @@ public function assemble($data = [], $reset = false, $encode = true, $partial = if (!empty($url) || $action !== $this->_defaults[$this->_actionKey]) { if ($encode) { - $action = urlencode($action); + $action = urlencode((string) $action); } $url = self::URI_DELIMITER . $action . $url; } if (!empty($url) || $controller !== $this->_defaults[$this->_controllerKey]) { if ($encode) { - $controller = urlencode($controller); + $controller = urlencode((string) $controller); } $url = self::URI_DELIMITER . $controller . $url; } if (isset($module)) { if ($encode) { - $module = urlencode($module); + $module = urlencode((string) $module); } $url = self::URI_DELIMITER . $module . $url; }