From 84d283c514296411bc7ef139a308f70e5f80d3b2 Mon Sep 17 00:00:00 2001 From: Arunas Mazeika Date: Mon, 17 Jun 2024 11:02:05 +0200 Subject: [PATCH] #680 Fix deprecation notices --- .../files/adapter/abstract.php | 1 + .../migrator/controller/export.php | 2 +- .../migrator/controller/import.php | 1 + .../migrator/behavior/export/database.php | 31 ++++++++++--------- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/code/libraries/joomlatools-components/files/adapter/abstract.php b/code/libraries/joomlatools-components/files/adapter/abstract.php index fefd64813..8cb55f6d6 100644 --- a/code/libraries/joomlatools-components/files/adapter/abstract.php +++ b/code/libraries/joomlatools-components/files/adapter/abstract.php @@ -13,6 +13,7 @@ * @author Ercan Ozkaya * @package Koowa\Component\Files */ +#[\AllowDynamicProperties] abstract class ComFilesAdapterAbstract extends KObject { /** diff --git a/code/libraries/joomlatools-components/migrator/controller/export.php b/code/libraries/joomlatools-components/migrator/controller/export.php index e995e46b9..8a65decff 100644 --- a/code/libraries/joomlatools-components/migrator/controller/export.php +++ b/code/libraries/joomlatools-components/migrator/controller/export.php @@ -6,7 +6,7 @@ * @link http://www.joomlatools.com */ - + #[\AllowDynamicProperties] class ComMigratorControllerExport extends ComMigratorControllerMigrator { protected function _initialize(KObjectConfig $config) diff --git a/code/libraries/joomlatools-components/migrator/controller/import.php b/code/libraries/joomlatools-components/migrator/controller/import.php index 05a365aa9..f5d7c3232 100644 --- a/code/libraries/joomlatools-components/migrator/controller/import.php +++ b/code/libraries/joomlatools-components/migrator/controller/import.php @@ -9,6 +9,7 @@ /** * Import Controller Class. */ +#[\AllowDynamicProperties] class ComMigratorControllerImport extends ComMigratorControllerMigrator { /** diff --git a/code/libraries/joomlatools-components/migrator/migrator/behavior/export/database.php b/code/libraries/joomlatools-components/migrator/migrator/behavior/export/database.php index 19ebe578b..faaeee755 100644 --- a/code/libraries/joomlatools-components/migrator/migrator/behavior/export/database.php +++ b/code/libraries/joomlatools-components/migrator/migrator/behavior/export/database.php @@ -153,20 +153,23 @@ protected function _quoteValue($value) $config = $this->getConfig(); - if(strpos($value, $config->separator) !== false) { // Separator is present in field - return true; - } - - if(strpos($value, $config->quote) !== false) { // Quote character is present in field - return true; - } - - if (strpos($value, "\n") !== false || strpos($value, "\r") !== false ) { // Newline is present in field - return true; - } - - if(substr($value, 0, 1) == " " || substr($value, -1) == " ") { // Space found at beginning or end of field value - return true; + if ($value) + { + if(strpos($value, $config->separator) !== false) { // Separator is present in field + return true; + } + + if(strpos($value, $config->quote) !== false) { // Quote character is present in field + return true; + } + + if (strpos($value, "\n") !== false || strpos($value, "\r") !== false ) { // Newline is present in field + return true; + } + + if(substr($value, 0, 1) == " " || substr($value, -1) == " ") { // Space found at beginning or end of field value + return true; + } } return false;