From 204087175eea88e439dcc9ba81260f98fbaa3c7d Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 13:53:32 +0200 Subject: [PATCH 01/26] Fix deprecated functionality: trim(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Core/Model/Config.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index bbe64a4760f..c22827afb83 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -1273,7 +1273,7 @@ public function getGroupedClassName($groupType, $classId, $groupRootNode = null) // First - check maybe the entity class was rewritten $className = null; if (isset($config->rewrite->$class)) { - $className = (string)$config->rewrite->$class; + $className = trim((string) $config->rewrite->$class); } else { /** * Backwards compatibility for pre-MMDB extensions. @@ -1284,13 +1284,11 @@ public function getGroupedClassName($groupType, $classId, $groupRootNode = null) $deprecatedNode = $config->deprecatedNode; $configOld = $this->_xml->global->{$groupType.'s'}->$deprecatedNode; if (isset($configOld->rewrite->$class)) { - $className = (string) $configOld->rewrite->$class; + $className = trim((string) $configOld->rewrite->$class); } } } - $className = trim($className); - // Second - if entity is not rewritten then use class prefix to form class name if (empty($className)) { if (!empty($config)) { From fcd55eb840cc472093c03db7d9c4f5b7e693a3f7 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 13:55:23 +0200 Subject: [PATCH 02/26] Fix deprecated functionality: PDOStatement::fetch(): passing null to parameter #2 ($cursorOrientation) of type int is deprecated --- lib/Zend/Db/Statement/Pdo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Zend/Db/Statement/Pdo.php b/lib/Zend/Db/Statement/Pdo.php index 00cf2108069..b03506175f6 100644 --- a/lib/Zend/Db/Statement/Pdo.php +++ b/lib/Zend/Db/Statement/Pdo.php @@ -245,7 +245,7 @@ public function _execute(array $params = null) * @return mixed Array, object, or scalar depending on fetch mode. * @throws Zend_Db_Statement_Exception */ - public function fetch($style = null, $cursor = null, $offset = null) + public function fetch($style = null, $cursor = PDO::FETCH_ORI_NEXT, $offset = 0) { if ($style === null) { $style = $this->_fetchMode; From 2ff0203518e5ef83a4e93b0e70022104393c5773 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 13:57:11 +0200 Subject: [PATCH 03/26] Fix deprecated functionality: str_replace(): passing null to parameter #3 ($subject) of type array|string is deprecated --- app/code/core/Mage/Core/Model/Resource/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/Model/Resource/Config.php b/app/code/core/Mage/Core/Model/Resource/Config.php index ff517bf8634..c9c5e83ff2c 100644 --- a/app/code/core/Mage/Core/Model/Resource/Config.php +++ b/app/code/core/Mage/Core/Model/Resource/Config.php @@ -101,7 +101,7 @@ public function loadToXml(Mage_Core_Model_Config $xmlConfig, $condition = null) if ($r['scope'] !== 'default') { continue; } - $value = str_replace($substFrom, $substTo, $r['value']); + $value = empty($r['value']) ? $r['value'] : str_replace($substFrom, $substTo, $r['value']); $xmlConfig->setNode('default/' . $r['path'], $value); } From 71d384e2573cc8df6c7615fb58f67d541c0205af Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:00:46 +0200 Subject: [PATCH 04/26] Fix deprecated functionality: strlen(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Core/Helper/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/Helper/Abstract.php b/app/code/core/Mage/Core/Helper/Abstract.php index 55410cca2ad..40240fdc1b1 100644 --- a/app/code/core/Mage/Core/Helper/Abstract.php +++ b/app/code/core/Mage/Core/Helper/Abstract.php @@ -215,7 +215,7 @@ public function escapeHtml($data, $allowedTags = null) } } else { // process single item - if (strlen($data)) { + if (is_string($data) && (strlen($data) > 0)) { if (is_array($allowedTags) && !empty($allowedTags)) { $allowed = implode('|', $allowedTags); $result = preg_replace('/<([\/\s\r\n]*)(' . $allowed . ')([\/\s\r\n]*)>/si', '##$1$2$3##', $data); From ba300aef30ce43c15db48aff040fbfc7925bbb6c Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:05:41 +0200 Subject: [PATCH 05/26] Fix deprecated functionality: strpos(): passing null to parameter #1 ($haystack) of type string is deprecated --- app/code/core/Mage/Core/Model/Design/Package.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index 2f9b9cd51ca..733720390a6 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -537,7 +537,7 @@ public function getSkinUrl($file = null, array $params = array()) Varien_Profiler::start(__METHOD__); // Prevent reading files outside of the proper directory while still allowing symlinked files - if (strpos($file, '..') !== false) { + if (is_string($file) && (strpos($file, '..') !== false)) { Mage::log(sprintf('Invalid path requested: %s (params: %s)', $file, json_encode($params)), Zend_Log::ERR); throw new Exception('Invalid path requested.'); } From d196a33499b5afd78800d68863b518b385cc8a88 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:06:51 +0200 Subject: [PATCH 06/26] Fix deprecated functionality: strtolower(): passing null to parameter #1 ($string) of type string is deprecated --- app/Mage.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Mage.php b/app/Mage.php index 666ca5e813c..30110ac1255 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -421,7 +421,8 @@ public static function getStoreConfig($path, $store = null) */ public static function getStoreConfigFlag($path, $store = null) { - $flag = strtolower(self::getStoreConfig($path, $store)); + $flag = self::getStoreConfig($path, $store); + $flag = is_string($flag) ? strtolower($flag) : $flag; if (!empty($flag) && 'false' !== $flag) { return true; } else { From 11fa00b6a778d2c99ba5a8501133b98a6f1f3b04 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:22:27 +0200 Subject: [PATCH 07/26] Fix deprecated functionality: addcslashes(): passing null to parameter #1 ($string) of type string is deprecated --- lib/Zend/Db/Adapter/Pdo/Abstract.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Zend/Db/Adapter/Pdo/Abstract.php b/lib/Zend/Db/Adapter/Pdo/Abstract.php index 8f36fcdaaa9..4a4fc741637 100644 --- a/lib/Zend/Db/Adapter/Pdo/Abstract.php +++ b/lib/Zend/Db/Adapter/Pdo/Abstract.php @@ -289,6 +289,9 @@ public function exec($sql) */ protected function _quote($value) { + if (is_null($value)) { + return "''"; + } if (is_int($value) || is_float($value)) { return $value; } From c070dc9385d6dbdaddadcc520d7a13676d5a0753 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:24:41 +0200 Subject: [PATCH 08/26] Fix deprecated functionality: strtolower(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php index c487d2363c1..0b0be489d34 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php @@ -301,7 +301,8 @@ public function setFilter($filterClass) protected function _getFilterByType() { - $type = strtolower($this->getType()); + $type = $this->getType(); + $type = is_string($type) ? strtolower($type) : $type; $filters = $this->getGrid()->getColumnFilters(); if (is_array($filters) && isset($filters[$type])) { return $filters[$type]; From 70e19ae1408aeca2d840d172c254a7401232ea66 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:25:56 +0200 Subject: [PATCH 09/26] Fix deprecated functionality: strtolower(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php index 0b0be489d34..47c49b541b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column.php @@ -206,7 +206,8 @@ public function setRenderer($renderer) protected function _getRendererByType() { - $type = strtolower($this->getType()); + $type = $this->getType(); + $type = is_string($type) ? strtolower($type) : $type; $renderers = $this->getGrid()->getColumnRenderers(); if (is_array($renderers) && isset($renderers[$type])) { From b1597cff9ba91cbe18e62512f1c27087d25fd785 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:27:23 +0200 Subject: [PATCH 10/26] Fix deprecated functionality: strtolower(): passing null to parameter #1 ($string) of type string is deprecated --- .../Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php index 3e65af203f2..9e4ebb2b33d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Abstract.php @@ -107,8 +107,9 @@ public function renderHeader() { if (false !== $this->getColumn()->getGrid()->getSortable() && false !== $this->getColumn()->getSortable()) { $className = 'not-sort'; - $dir = strtolower($this->getColumn()->getDir()); - $nDir= ($dir=='asc') ? 'desc' : 'asc'; + $dir = $this->getColumn()->getDir(); + $dir = is_string($dir) ? strtolower($dir) : $dir; + $nDir = ($dir == 'asc') ? 'desc' : 'asc'; if ($this->getColumn()->getDir()) { $className = 'sort-arrow-' . $dir; } From b1950b27396e36b3abf044835111d60ae8a2b1c9 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:29:10 +0200 Subject: [PATCH 11/26] Fix deprecated functionality: htmlspecialchars(): passing null to parameter #1 ($string) of type string is deprecated --- .../Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php index e11dace6f34..2965712b328 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Abstract.php @@ -94,7 +94,8 @@ protected function _getHtmlId() */ public function getEscapedValue($index = null) { - return htmlspecialchars($this->getValue($index)); + $value = $this->getValue($index); + return is_string($value) ? htmlspecialchars($value) : $value; } /** From cedc039d223725e10601e36a89a74998ea62f6ad Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:32:22 +0200 Subject: [PATCH 12/26] Fix deprecated functionality: auto_detect_line_endings is deprecated --- lib/Varien/Io/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Varien/Io/File.php b/lib/Varien/Io/File.php index 052df5cca65..0da486fc32f 100644 --- a/lib/Varien/Io/File.php +++ b/lib/Varien/Io/File.php @@ -130,7 +130,7 @@ public function streamOpen($fileName, $mode = 'w+', $chmod = 0666) throw new Exception('Permission denied for write to ' . $this->getFilteredPath($this->_cwd)); } - if (!ini_get('auto_detect_line_endings')) { + if ((PHP_VERSION_ID < 80100) && !ini_get('auto_detect_line_endings')) { ini_set('auto_detect_line_endings', 1); } From a669060c125057ca8647cc631943ffb09695615b Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:35:14 +0200 Subject: [PATCH 13/26] Fix deprecated functionality: trim(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php index aed9e3f8ca9..20e0ed4e06c 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php @@ -638,7 +638,8 @@ public function getBackendTable() if ($this->isStatic()) { $this->_dataTable = $this->getEntityType()->getValueTablePrefix(); } else { - $backendTable = trim($this->_getData('backend_table')); + $backendTable = $this->_getData('backend_table'); + $backendTable = is_string($backendTable) ? trim($backendTable) : $backendTable; if (empty($backendTable)) { $entityTable = array($this->getEntity()->getEntityTablePrefix(), $this->getBackendType()); $backendTable = $this->getResource()->getTable($entityTable); From f53c0e30fe9e9e33aa70107ad2077550b98ec2fb Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:36:53 +0200 Subject: [PATCH 14/26] Fix deprecated functionality: trim(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Eav/Model/Entity/Type.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Eav/Model/Entity/Type.php b/app/code/core/Mage/Eav/Model/Entity/Type.php index aa72313f18d..a7d01db7cc5 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Entity/Type.php @@ -264,7 +264,8 @@ public function getValueTablePrefix() */ public function getEntityTablePrefix() { - $tablePrefix = trim($this->_data['value_table_prefix']); + $tablePrefix = $this->_data['value_table_prefix']; + $tablePrefix = is_string($tablePrefix) ? trim($tablePrefix) : $tablePrefix; if (empty($tablePrefix)) { $tablePrefix = $this->getEntityTable(); From 8fd3228fcd849e2d4eb69dec5d5975f797576ea5 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 19:05:09 +0200 Subject: [PATCH 15/26] Fix deprecated functionality: urlencode(): Passing null to parameter #1 ($string) of type string is deprecated --- lib/Zend/Locale/Data.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Zend/Locale/Data.php b/lib/Zend/Locale/Data.php index 5d573876506..281db1adf45 100644 --- a/lib/Zend/Locale/Data.php +++ b/lib/Zend/Locale/Data.php @@ -340,7 +340,7 @@ public static function getList($locale, $path, $value = false) $val = implode('_' , $value); } - $val = urlencode($val); + $val = is_string($val) ? urlencode($val) : $val; $id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val); // add runtime cache to avoid calling cache backend multiple times during one request @@ -998,7 +998,8 @@ public static function getContent($locale, $path, $value = false) if (is_array($value)) { $val = implode('_' , $value); } - $val = urlencode($val); + + $val = is_string($val) ? urlencode($val) : $val; $id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val); // add runtime cache to avoid calling cache backend multiple times during one request From 7c9297715e56e440671dfb1146bddcac14845743 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:41:53 +0200 Subject: [PATCH 16/26] Fix deprecated functionality: preg_split(): passing null to parameter #3 ($limit) of type int is deprecated --- app/code/core/Mage/Core/Helper/String.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 41d8c96afd0..737a6f0c26a 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -187,7 +187,7 @@ public function str_split($str, $length = 1, $keepWords = false, $trim = false, } } // split smartly, keeping words else { - $split = preg_split('/(' . $wordSeparatorRegex . '+)/siu', $str, null, PREG_SPLIT_DELIM_CAPTURE); + $split = preg_split('/(' . $wordSeparatorRegex . '+)/siu', $str, -1, PREG_SPLIT_DELIM_CAPTURE); $i = 0; $space = ''; $spaceLen = 0; From 75841c2afc5c89cf5ff1112d708fe035b7c42d62 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:52:49 +0200 Subject: [PATCH 17/26] Fix deprecated functionality: htmlspecialchars(): passing null to parameter #1 ($string) of type string is deprecated --- lib/Varien/Data/Form/Element/Abstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Varien/Data/Form/Element/Abstract.php b/lib/Varien/Data/Form/Element/Abstract.php index 3c7836d4024..27b8686f803 100644 --- a/lib/Varien/Data/Form/Element/Abstract.php +++ b/lib/Varien/Data/Form/Element/Abstract.php @@ -214,7 +214,7 @@ public function removeClass($class) */ protected function _escape($string) { - return htmlspecialchars($string, ENT_COMPAT); + return is_string($string) ? htmlspecialchars($string, ENT_COMPAT) : $string; } /** From aef2d2681fcf97caa940b3e18634057fb97db12c Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:54:18 +0200 Subject: [PATCH 18/26] Fix deprecated functionality: preg_match(): passing null to parameter #2 ($subject) of type string is deprecated --- .../Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php index 7fb967c245e..226b207d2f2 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php @@ -41,8 +41,8 @@ class Mage_Eav_Model_Entity_Attribute_Backend_Time_Created extends Mage_Eav_Mode */ protected function _getFormat($date) { - if (is_string($date) && preg_match('#^\d{4,4}-\d{2,2}-\d{2,2}\s\d{2,2}:\d{2,2}:\d{2,2}$#', $date) - || preg_match('#^\d{4,4}-\d{2,2}-\d{2,2}\w{1,1}\d{2,2}:\d{2,2}:\d{2,2}[+-]\d{2,2}:\d{2,2}$#', $date)) { + if (is_string($date) && (preg_match('#^\d{4,4}-\d{2,2}-\d{2,2}\s\d{2,2}:\d{2,2}:\d{2,2}$#', $date) + || preg_match('#^\d{4,4}-\d{2,2}-\d{2,2}\w{1,1}\d{2,2}:\d{2,2}:\d{2,2}[+-]\d{2,2}:\d{2,2}$#', $date))) { return 'yyyy-MM-dd HH:mm:ss'; } return null; From 7a4aa96dab1a6433a5c93ab61b3950cc1b0cf0c4 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 14:55:33 +0200 Subject: [PATCH 19/26] Fix deprecated functionality: explode(): passing null to parameter #2 ($string) of type string is deprecated --- app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php index d7357b059fe..d90ce30858a 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php @@ -135,7 +135,7 @@ public function outputValue($format = Mage_Eav_Model_Attribute_Data::OUTPUT_FORM { $values = $this->getEntity()->getData($this->getAttribute()->getAttributeCode()); if (!is_array($values)) { - $values = explode("\n", $values); + $values = is_string($values) ? explode("\n", $values) : []; } $values = array_map(array($this, '_applyOutputFilter'), $values); switch ($format) { From d81b47fa5578b3f58ca8e5a16409be96230e769c Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 15:00:46 +0200 Subject: [PATCH 20/26] Fix deprecated functionality: explode(): passing null to parameter #2 ($string) of type string is deprecated --- lib/Varien/Data/Form/Element/Multiselect.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Varien/Data/Form/Element/Multiselect.php b/lib/Varien/Data/Form/Element/Multiselect.php index 592426bf015..6c491043cfc 100644 --- a/lib/Varien/Data/Form/Element/Multiselect.php +++ b/lib/Varien/Data/Form/Element/Multiselect.php @@ -77,7 +77,7 @@ public function getElementHtml() $value = $this->getValue(); if (!is_array($value)) { - $value = explode(',', $value); + $value = is_string($value) ? explode(',', $value) : []; } if ($values = $this->getValues()) { From 060654b53c4d6f33ce9ae7306924ed5ed7f222e9 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 18:07:37 +0200 Subject: [PATCH 21/26] Fix deprecated functionality: strpos(): passing null to parameter #1 ($haystack) of type string is deprecated --- lib/Varien/Object.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index b7638f859eb..0ef1554a375 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -340,7 +340,7 @@ public function getData($key='', $index=null) $default = null; // accept a/b/c as ['a']['b']['c'] - if (strpos($key,'/')) { + if (is_string($key) && strpos($key, '/')) { $keyArr = explode('/', $key); $data = $this->_data; foreach ($keyArr as $i=>$k) { From 88cad3f43d43b04364cced6f05fd84104e77703d Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 18:12:40 +0200 Subject: [PATCH 22/26] Fix deprecated functionality: preg_match(): passing null to parameter #2 ($subject) of type string is deprecated --- .../adminhtml/default/default/template/widget/tabs.phtml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/design/adminhtml/default/default/template/widget/tabs.phtml b/app/design/adminhtml/default/default/template/widget/tabs.phtml index e7ef747e602..9bbcb2168b9 100644 --- a/app/design/adminhtml/default/default/template/widget/tabs.phtml +++ b/app/design/adminhtml/default/default/template/widget/tabs.phtml @@ -24,15 +24,15 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -getTitle()): ?> +getTitle()): ?>

getTitle() ?>

- +
    canShowTab($_tab)): continue; endif; ?> -
  • getTabIsHidden($_tab)): ?> style="display:none"> - +
  • getTabIsHidden($_tab)): ?> style="display:none"> + getTabLabel($_tab); ?> From 82ffa4c82968ee035ff5b502f99ac6587a3e9e48 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Sat, 9 Oct 2021 18:16:55 +0200 Subject: [PATCH 23/26] Fix deprecated functionality: str_replace(): passing null to parameter #2 ($replace) of type array|string is deprecated --- lib/Varien/Object.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index 0ef1554a375..1cf9ba638fc 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -609,7 +609,7 @@ public function toString($format='') } else { preg_match_all('/\{\{([a-z0-9_]+)\}\}/is', $format, $matches); foreach ($matches[1] as $var) { - $format = str_replace('{{'.$var.'}}', $this->getData($var), $format); + $format = str_replace('{{'.$var.'}}', (string) $this->getData($var), $format); } $str = $format; } From 77c582d90c3794ab393fc4cee57896253a275448 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Thu, 14 Oct 2021 19:19:23 +0200 Subject: [PATCH 24/26] Fix deprecated functionality: strtotime(): passing null to parameter #1 ($datetime) of type string is deprecated --- app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php index be686dc4eda..dc356f4a217 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php @@ -140,8 +140,8 @@ public function getStoreLastLoginDateTimezone() public function getCurrentStatus() { $log = $this->getCustomerLog(); - if ($log->getLogoutAt() || - strtotime(now())-strtotime($log->getLastVisitAt())>Mage_Log_Model_Visitor::getOnlineMinutesInterval()*60) { + if ($log->getLogoutAt() || (!empty($log->getLastVisitAt()) && + (strtotime(now()) - strtotime($log->getLastVisitAt()) > Mage_Log_Model_Visitor::getOnlineMinutesInterval() * 60))) { return Mage::helper('customer')->__('Offline'); } return Mage::helper('customer')->__('Online'); From 274f65ad47dc68872415da7ad49d26af69b47a7a Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Thu, 14 Oct 2021 19:27:52 +0200 Subject: [PATCH 25/26] Fix deprecated functionality: trim(): passing null to parameter #1 ($string) of type string is deprecated --- app/code/core/Mage/Core/Model/Config.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index c22827afb83..975821db3b7 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -1315,7 +1315,7 @@ public function getGroupedClassName($groupType, $classId, $groupRootNode = null) */ public function getBlockClassName($blockType) { - if (strpos($blockType, '/')===false) { + if (strpos($blockType, '/') === false) { return $blockType; } return $this->getGroupedClassName('block', $blockType); @@ -1365,11 +1365,13 @@ public function getResourceHelper($moduleName) */ public function getModelClassName($modelClass) { - $modelClass = trim($modelClass); - if (strpos($modelClass, '/')===false) { - return $modelClass; + if (empty($modelClass)) { + return ''; } - return $this->getGroupedClassName('model', $modelClass); + if (strpos($modelClass, '/') === false) { + return trim($modelClass); + } + return $this->getGroupedClassName('model', trim($modelClass)); } /** From c2e12d5aad22168b1db0dc144daa275e819edfe0 Mon Sep 17 00:00:00 2001 From: Fabrice Creuzot Date: Thu, 14 Oct 2021 20:11:41 +0200 Subject: [PATCH 26/26] Fix deprecated functionality: preg_match(): passing null to parameter #2 ($subject) of type string is deprecated --- .../default/template/widget/tabshoriz.phtml | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml b/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml index 4eba8fd8d03..9762a5cc498 100644 --- a/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml +++ b/app/design/adminhtml/default/default/template/widget/tabshoriz.phtml @@ -24,22 +24,19 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> - - - - + + +