From e771e7d243c209ccab17d51005242770defa27af Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Sun, 1 Jan 2023 04:11:34 +0200 Subject: [PATCH] Adds some PHP 8 ready changes to compiler classes. Adds Server and Crypt classes. --- README.md | 6 +- admin/README.txt | 6 +- admin/helpers/compiler.php | 30 +- admin/helpers/compiler/a_Get.php | 286 ++++----- admin/helpers/compiler/b_Structure.php | 104 ++-- admin/helpers/compiler/c_Fields.php | 108 ++-- admin/helpers/compiler/e_Interpretation.php | 543 +++++++++--------- admin/helpers/compiler/f_Infusion.php | 34 +- admin/helpers/extrusion/a_mapping.php | 41 +- admin/helpers/extrusion/b_builder.php | 10 +- admin/helpers/extrusion/c_extrusion.php | 11 +- admin/sql/install.mysql.utf8.sql | 20 +- componentbuilder.xml | 2 +- .../Componentbuilder/Abstraction/Model.php | 233 ++++++++ .../Compiler/Customcode/Gui.php | 13 +- .../Compiler/Customcode/Hash.php | 8 +- .../Compiler/Customcode/LockBase.php | 4 +- .../Extension/JoomlaThree/InstallScript.php | 2 +- .../Compiler/Field/Customcode.php | 8 +- .../Componentbuilder/Compiler/Field/Data.php | 16 +- .../Field/JoomlaThree/CoreValidation.php | 4 +- .../Compiler/Field/TypeName.php | 6 +- .../Compiler/Field/Validation.php | 2 +- .../Compiler/JoomlaThree/History.php | 4 +- .../Compiler/Language/Extractor.php | 9 +- .../Componentbuilder/Compiler/Placeholder.php | 25 +- .../Compiler/Placeholder/Reverse.php | 12 +- .../src/Componentbuilder/Compiler/Power.php | 99 ++-- .../Compiler/Power/Infusion.php | 4 +- .../Componentbuilder/Compiler/Registry.php | 4 +- .../Compiler/Service/Database.php | 72 +++ .../Compiler/Service/Model.php | 58 ++ .../Compiler/Utilities/Path.php | 4 +- .../VDM.Joomla/src/Componentbuilder/Crypt.php | 153 +++++ .../src/Componentbuilder/Crypt/FOF.php | 204 +++++++ .../src/Componentbuilder/Crypt/KeyLoader.php | 26 + .../src/Componentbuilder/Crypt/Password.php | 46 ++ .../src/Componentbuilder/Crypt/Random.php | 26 + .../src/Componentbuilder/Crypt/index.html | 1 + .../src/Componentbuilder/Database/Insert.php | 9 +- .../Interfaces/Cryptinterface.php | 43 ++ .../Interfaces/ModelInterface.php | 71 +++ .../Interfaces/Serverinterface.php | 42 ++ .../Package/Database/Insert.php | 2 +- .../Search/Abstraction/Engine.php | 2 +- .../src/Componentbuilder/Search/Agent.php | 4 +- .../Componentbuilder/Search/Agent/Search.php | 38 +- .../Componentbuilder/Search/Agent/Update.php | 4 +- .../Search/Database/Insert.php | 2 +- .../Componentbuilder/Search/Model/Insert.php | 2 +- .../Componentbuilder/Search/Model/Load.php | 4 +- .../src/Componentbuilder/Server.php | 147 +++++ .../src/Componentbuilder/Server/Ftp.php | 139 +++++ .../src/Componentbuilder/Server/Load.php | 122 ++++ .../Componentbuilder/Server/Model/Load.php | 135 +++++ .../Componentbuilder/Server/Model/index.html | 1 + .../src/Componentbuilder/Server/Sftp.php | 185 ++++++ .../src/Componentbuilder/Server/index.html | 1 + .../src/Componentbuilder/Service/Crypt.php | 42 +- .../src/Componentbuilder/Service/Server.php | 114 ++++ .../VDM.Joomla/src/Utilities/ArrayHelper.php | 2 +- .../src/Utilities/Component/Helper.php | 55 +- .../VDM.Joomla/src/Utilities/GuidHelper.php | 79 ++- .../VDM.Joomla/src/Utilities/JsonHelper.php | 10 +- .../Utilities/String/ClassfunctionHelper.php | 4 +- .../src/Utilities/String/FieldHelper.php | 8 +- .../src/Utilities/String/NamespaceHelper.php | 4 +- .../src/Utilities/String/PluginHelper.php | 8 +- .../src/Utilities/String/TypeHelper.php | 2 +- .../VDM.Joomla/src/Utilities/StringHelper.php | 38 +- .../phpseclib/Crypt/Common/SymmetricKey.php | 6 +- 71 files changed, 2697 insertions(+), 872 deletions(-) create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Abstraction/Model.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Database.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Compiler/Service/Model.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Crypt.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Crypt/FOF.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Crypt/KeyLoader.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Crypt/Password.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Crypt/Random.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Crypt/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Interfaces/Cryptinterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Interfaces/ModelInterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Interfaces/Serverinterface.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Ftp.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Load.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Model/Load.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Model/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/Sftp.php create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Server/index.html create mode 100644 libraries/jcb_powers/VDM.Joomla/src/Componentbuilder/Service/Server.php diff --git a/README.md b/README.md index 5541ea295..07db697c4 100644 --- a/README.md +++ b/README.md @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 29th December, 2023 ++ *Last Build*: 1st January, 2023 + *Version*: 3.1.13 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **341727** ++ *Line count*: **342047** + *Field count*: **2009** -+ *File count*: **2222** ++ *File count*: **2225** + *Folder count*: **391** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index 5541ea295..07db697c4 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -140,13 +140,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 29th December, 2023 ++ *Last Build*: 1st January, 2023 + *Version*: 3.1.13 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **341727** ++ *Line count*: **342047** + *Field count*: **2009** -+ *File count*: **2222** ++ *File count*: **2225** + *Folder count*: **391** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com). diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index 3fe409ef9..61915e6cc 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -19,6 +19,7 @@ use VDM\Joomla\Utilities\StringHelper; use VDM\Joomla\Utilities\ArrayHelper; use VDM\Joomla\Utilities\ObjectHelper; use VDM\Joomla\Utilities\FileHelper; +use VDM\Joomla\Utilities\GetHelper; use VDM\Joomla\Utilities\MathHelper; use VDM\Joomla\Componentbuilder\Compiler\Factory as CFactory; use VDM\Joomla\Componentbuilder\Compiler\Utilities\Placefix; @@ -34,7 +35,6 @@ ComponentbuilderHelper::autoLoader(); class Compiler extends Infusion { - /** * The Temp path * @@ -106,19 +106,17 @@ class Compiler extends Infusion // clear form component xml $xmlPath = $this->componentPath . '/' . CFactory::_('Content')->get('component') . '.xml'; - $componentXML = ComponentbuilderHelper::getFileContents( - $xmlPath - ); - $textToSite = ComponentbuilderHelper::getBetween( + $componentXML = FileHelper::getContent($xmlPath); + $textToSite = GetHelper::between( $componentXML, '', '' ); - $textToSiteLang = ComponentbuilderHelper::getBetween( + $textToSiteLang = GetHelper::between( $componentXML, '', '' ); $componentXML = str_replace( array('' . $textToSite . "", '' . $textToSiteLang - . ""), array('', ''), $componentXML + . ""), array('', ''), (string) $componentXML ); $this->writeFile($xmlPath, $componentXML); } @@ -383,7 +381,7 @@ class Compiler extends Infusion && ArrayHelper::check($this->newFiles['dynamic'])) { // get the bom file - $bom = ComponentbuilderHelper::getFileContents($this->bomPath); + $bom = FileHelper::getContent($this->bomPath); // first we do the static files foreach ($this->newFiles['static'] as $static) { @@ -640,7 +638,7 @@ class Compiler extends Infusion $php = "trigger( 'jcb_ce_onGetFileContents', @@ -648,10 +646,10 @@ class Compiler extends Infusion &$view) ); // see if we should add a BOM - if (strpos($string, Placefix::_h('BOM')) !== false) + if (strpos((string) $string, (string) Placefix::_h('BOM')) !== false) { list($wast, $code) = explode( - Placefix::_h('BOM'), $string + Placefix::_h('BOM'), (string) $string ); $string = $php . $bom . $code; } @@ -678,7 +676,7 @@ class Compiler extends Infusion // add answer back to file $this->writeFile($path, $answer); // count the file lines - $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); + $this->lineCount = $this->lineCount + substr_count((string) $answer, PHP_EOL); } /** @@ -884,7 +882,7 @@ class Compiler extends Infusion $this->buildReadMeData(); } // get the file - $string = ComponentbuilderHelper::getFileContents($path); + $string = FileHelper::getContent($path); // update the file $answer = CFactory::_('Placeholder')->update($string, CFactory::_('Content')->active); // add to zip array @@ -1506,7 +1504,7 @@ class Compiler extends Infusion $_commentType = " -->"; } // escape the code - $code = explode(PHP_EOL, $target['code']); + $code = explode(PHP_EOL, (string) $target['code']); $code = PHP_EOL . $commentType . implode( $_commentType . PHP_EOL . $commentType, $code ) . $_commentType . PHP_EOL; @@ -1540,10 +1538,10 @@ class Compiler extends Infusion // move to the position where we should add the data fseek($fpFile, $position); // Add the data - fwrite($fpFile, $data); + fwrite($fpFile, (string) $data); // truncate file at the end of the data that was added $remove = MathHelper::bc( - 'add', $position, mb_strlen($data, '8bit') + 'add', $position, mb_strlen((string) $data, '8bit') ); ftruncate($fpFile, $remove); // check if this was a replacement of data diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 123d7a895..8adf46b61 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -1076,7 +1076,7 @@ class Get array(&$this->componentContext, &$this) ); // make sure we have a version - if (strpos($this->componentData->component_version, '.') + if (strpos((string) $this->componentData->component_version, '.') === false) { $this->componentData->component_version = '1.0.0'; @@ -1090,7 +1090,7 @@ class Get { // set the new version $version = (array) explode( - '.', $this->componentData->component_version + '.', (string) $this->componentData->component_version ); // get last key end($version); @@ -1321,7 +1321,7 @@ class Get // ensure version naming is correct $this->component_version = preg_replace( - '/[^0-9.]+/', '', $component->component_version + '/[^0-9.]+/', '', (string) $component->component_version ); // set the add targets @@ -1337,7 +1337,7 @@ class Get ) && JsonHelper::check( $component->{'add' . $addTarget} - )) ? json_decode($component->{'add' . $addTarget}, true) : null; + )) ? json_decode((string) $component->{'add' . $addTarget}, true) : null; if (ArrayHelper::check( $component->{'add' . $addTarget} )) @@ -1383,7 +1383,7 @@ class Get && StringHelper::check($component->website)) { $component->whmcs_buy_link = $component->website; - $component->whmcs_url = rtrim($component->website, '/') + $component->whmcs_url = rtrim((string) $component->website, '/') . '/whmcs'; } // none set @@ -1413,7 +1413,7 @@ class Get // set the addcustommenus data $component->addcustommenus = (isset($component->addcustommenus) && JsonHelper::check($component->addcustommenus)) - ? json_decode($component->addcustommenus, true) : null; + ? json_decode((string) $component->addcustommenus, true) : null; if (ArrayHelper::check($component->addcustommenus)) { $component->custommenus = array_values($component->addcustommenus); @@ -1423,7 +1423,7 @@ class Get // set the sql_tweak data $component->sql_tweak = (isset($component->sql_tweak) && JsonHelper::check($component->sql_tweak)) - ? json_decode($component->sql_tweak, true) : null; + ? json_decode((string) $component->sql_tweak, true) : null; if (ArrayHelper::check($component->sql_tweak)) { // build the tweak settings @@ -1455,7 +1455,7 @@ class Get // set the admin_view data $component->addadmin_views = (isset($component->addadmin_views) && JsonHelper::check($component->addadmin_views)) - ? json_decode($component->addadmin_views, true) : null; + ? json_decode((string) $component->addadmin_views, true) : null; if (ArrayHelper::check($component->addadmin_views)) { CFactory::_('Config')->lang_target = 'admin'; @@ -1549,7 +1549,7 @@ class Get // set the site_view data $component->addsite_views = (isset($component->addsite_views) && JsonHelper::check($component->addsite_views)) - ? json_decode($component->addsite_views, true) : null; + ? json_decode((string) $component->addsite_views, true) : null; if (ArrayHelper::check($component->addsite_views)) { CFactory::_('Config')->lang_target = 'site'; @@ -1586,7 +1586,7 @@ class Get = (isset($component->addcustom_admin_views) && JsonHelper::check( $component->addcustom_admin_views - )) ? json_decode($component->addcustom_admin_views, true) : null; + )) ? json_decode((string) $component->addcustom_admin_views, true) : null; if (ArrayHelper::check( $component->addcustom_admin_views )) @@ -1623,7 +1623,7 @@ class Get // set the config data $component->addconfig = (isset($component->addconfig) && JsonHelper::check($component->addconfig)) - ? json_decode($component->addconfig, true) : null; + ? json_decode((string) $component->addconfig, true) : null; if (ArrayHelper::check($component->addconfig)) { $component->config = array_map( @@ -1654,7 +1654,7 @@ class Get // set the addcustommenus data $component->addcontributors = (isset($component->addcontributors) && JsonHelper::check($component->addcontributors)) - ? json_decode($component->addcontributors, true) : null; + ? json_decode((string) $component->addcontributors, true) : null; if (ArrayHelper::check($component->addcontributors)) { $this->addContributors = true; @@ -1667,7 +1667,7 @@ class Get // set the addcustommenus data $component->version_update = (isset($component->version_update) && JsonHelper::check($component->version_update)) - ? json_decode($component->version_update, true) : null; + ? json_decode((string) $component->version_update, true) : null; if (ArrayHelper::check($component->version_update)) { $component->version_update = array_values( @@ -1693,7 +1693,7 @@ class Get )) { $this->setUpdateSQL( - json_decode($old_admin_views->addadmin_views, true), + json_decode((string) $old_admin_views->addadmin_views, true), $component->addadmin_views, 'adminview' ); } @@ -1701,7 +1701,7 @@ class Get if (ObjectHelper::check($old_component)) { $old_component_version = preg_replace( - '/[^0-9.]+/', '', $old_component->component_version + '/[^0-9.]+/', '', (string) $old_component->component_version ); if ($old_component_version != $this->component_version) { @@ -1942,7 +1942,7 @@ class Get if ($component->addreadme) { $component->readme = CFactory::_('Customcode')->update( - base64_decode($component->readme) + base64_decode((string) $component->readme) ); } else @@ -1956,7 +1956,7 @@ class Get // dashboard methods $component->dashboard_tab = (isset($component->dashboard_tab) && JsonHelper::check($component->dashboard_tab)) - ? json_decode($component->dashboard_tab, true) : null; + ? json_decode((string) $component->dashboard_tab, true) : null; if (ArrayHelper::check($component->dashboard_tab)) { $component->dashboard_tab = array_map( @@ -1980,7 +1980,7 @@ class Get // load the php for the dashboard model $component->php_dashboard_methods = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($component->php_dashboard_methods) + base64_decode((string) $component->php_dashboard_methods) ), array( 'table' => 'component_dashboard', @@ -2029,15 +2029,15 @@ class Get $component->toignore )) { - if (strpos($component->toignore, ',') !== false) + if (strpos((string) $component->toignore, ',') !== false) { $component->toignore = array_map( - 'trim', (array) explode(',', $component->toignore) + 'trim', (array) explode(',', (string) $component->toignore) ); } else { - $component->toignore = array(trim($component->toignore)); + $component->toignore = array(trim((string) $component->toignore)); } } else @@ -2048,7 +2048,7 @@ class Get // get all modules $component->addjoomla_modules = (isset($component->addjoomla_modules) && JsonHelper::check($component->addjoomla_modules)) - ? json_decode($component->addjoomla_modules, true) : null; + ? json_decode((string) $component->addjoomla_modules, true) : null; if (ArrayHelper::check($component->addjoomla_modules)) { $joomla_modules = array_map( @@ -2069,7 +2069,7 @@ class Get // get all plugins $component->addjoomla_plugins = (isset($component->addjoomla_plugins) && JsonHelper::check($component->addjoomla_plugins)) - ? json_decode($component->addjoomla_plugins, true) : null; + ? json_decode((string) $component->addjoomla_plugins, true) : null; if (ArrayHelper::check($component->addjoomla_plugins)) { $joomla_plugins = array_map( @@ -2228,7 +2228,7 @@ class Get // check the length of the view name (+5 for com_ and _) $name_length = CFactory::_('Config')->component_code_name_length + strlen( - $view->name_single_code + (string) $view->name_single_code ) + 5; // when the name is larger than 49 we need to add the assets' table name fix if ($name_length > 49) @@ -2304,7 +2304,7 @@ class Get // add the tables $view->addtables = (isset($view->addtables) && JsonHelper::check($view->addtables)) - ? json_decode($view->addtables, true) : null; + ? json_decode((string) $view->addtables, true) : null; if (ArrayHelper::check($view->addtables)) { $view->tables = array_values($view->addtables); @@ -2316,7 +2316,7 @@ class Get $view->customtabs = (isset($view->customtabs) && JsonHelper::check($view->customtabs)) - ? json_decode($view->customtabs, true) : null; + ? json_decode((string) $view->customtabs, true) : null; if (ArrayHelper::check($view->customtabs)) { // setup custom tabs to global data sets @@ -2355,8 +2355,8 @@ class Get $_tab = Indent::_(1); } // check if the php of the tab is set, if not load it now - if (strpos($tab['html'], 'bootstrap.addTab') === false - && strpos($tab['html'], 'bootstrap.endTab') + if (strpos((string) $tab['html'], 'bootstrap.addTab') === false + && strpos((string) $tab['html'], 'bootstrap.endTab') === false) { // add the tab @@ -2371,7 +2371,7 @@ class Get . '
'; $tmp .= PHP_EOL . $_tab . Indent::_(4) . implode( PHP_EOL . $_tab . Indent::_(4), - (array) explode(PHP_EOL, trim($tab['html'])) + (array) explode(PHP_EOL, trim((string) $tab['html'])) ); $tmp .= PHP_EOL . $_tab . Indent::_(3) . '
'; $tmp .= PHP_EOL . $_tab . Indent::_(2) . ''; @@ -2385,7 +2385,7 @@ class Get $tab['html'] = PHP_EOL . $_tab . Indent::_(1) . implode( PHP_EOL . $_tab . Indent::_(1), - (array) explode(PHP_EOL, trim($tab['html'])) + (array) explode(PHP_EOL, trim((string) $tab['html'])) ); } // add the permissions if needed @@ -2435,13 +2435,13 @@ class Get // add the local tabs $view->addtabs = (isset($view->addtabs) && JsonHelper::check($view->addtabs)) - ? json_decode($view->addtabs, true) : null; + ? json_decode((string) $view->addtabs, true) : null; if (ArrayHelper::check($view->addtabs)) { $nr = 1; foreach ($view->addtabs as $tab) { - $view->tabs[$nr] = trim($tab['name']); + $view->tabs[$nr] = trim((string) $tab['name']); $nr++; } } @@ -2463,7 +2463,7 @@ class Get // add permissions $view->addpermissions = (isset($view->addpermissions) && JsonHelper::check($view->addpermissions)) - ? json_decode($view->addpermissions, true) : null; + ? json_decode((string) $view->addpermissions, true) : null; if (ArrayHelper::check($view->addpermissions)) { $view->permissions = array_values($view->addpermissions); @@ -2474,7 +2474,7 @@ class Get // set fields $view->addfields = (isset($view->addfields) && JsonHelper::check($view->addfields)) - ? json_decode($view->addfields, true) : null; + ? json_decode((string) $view->addfields, true) : null; if (ArrayHelper::check($view->addfields)) { $ignoreFields = array(); @@ -2516,7 +2516,7 @@ class Get )) { $this->setUpdateSQL( - json_decode($old_view->addfields, true), + json_decode((string) $old_view->addfields, true), $view->addfields, 'field', $view->name_single_code, $ignoreFields ); @@ -2600,7 +2600,7 @@ class Get $tmpfield['settings']->xml = CFactory::_('Customcode')->update( json_decode( - $field['settings']->history->xml + (string) $field['settings']->history->xml ) ); // add properties from current field as it is generic @@ -2702,7 +2702,7 @@ class Get // set the conditions $view->addconditions = (isset($view->addconditions) && JsonHelper::check($view->addconditions)) - ? json_decode($view->addconditions, true) : null; + ? json_decode((string) $view->addconditions, true) : null; if (ArrayHelper::check($view->addconditions)) { $view->conditions = array(); @@ -2805,7 +2805,7 @@ class Get // set the relations $view->addrelations = (isset($view->addrelations) && JsonHelper::check($view->addrelations)) - ? json_decode($view->addrelations, true) : null; + ? json_decode((string) $view->addrelations, true) : null; if (ArrayHelper::check($view->addrelations)) { foreach ($view->addrelations as $nr => $relationsValue) @@ -2853,7 +2853,7 @@ class Get )) { $check_column_name = trim( - strtolower($relationsValue['column_name']) + strtolower((string) $relationsValue['column_name']) ); // confirm it should really make the over ride if ('default' !== $check_column_name) @@ -2886,7 +2886,7 @@ class Get $view->addlinked_views = (isset($view->addlinked_views) && JsonHelper::check($view->addlinked_views)) - ? json_decode($view->addlinked_views, true) : null; + ? json_decode((string) $view->addlinked_views, true) : null; if (ArrayHelper::check($view->addlinked_views)) { // setup linked views to global data sets @@ -2932,9 +2932,9 @@ class Get true ); // check if a token must be set - if (strpos($view->$scripter, "token") !== false + if (strpos((string) $view->$scripter, "token") !== false || strpos( - $view->$scripter, "task=ajax" + (string) $view->$scripter, "task=ajax" ) !== false) { if (!CFactory::_('Customcode.Dispenser')->hub['token'][$view->name_single_code]) @@ -3026,7 +3026,7 @@ class Get $view->{$button_code_field} = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($view->{$button_code_field}) + base64_decode((string) $view->{$button_code_field}) ), $guiMapper ); @@ -3040,7 +3040,7 @@ class Get // set the button array $view->custom_button = (isset($view->custom_button) && JsonHelper::check($view->custom_button)) - ? json_decode($view->custom_button, true) : null; + ? json_decode((string) $view->custom_button, true) : null; if (ArrayHelper::check($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); @@ -3059,7 +3059,7 @@ class Get { if (isset($view->$importScripter) && strlen( - $view->$importScripter + (string) $view->$importScripter ) > 0) { // update GUI mapper field @@ -3109,7 +3109,7 @@ class Get // check if controller input as been set $view->ajax_input = (isset($view->ajax_input) && JsonHelper::check($view->ajax_input)) - ? json_decode($view->ajax_input, true) : null; + ? json_decode((string) $view->ajax_input, true) : null; if (ArrayHelper::check($view->ajax_input)) { if ($addAjaxSite) @@ -3161,7 +3161,7 @@ class Get && JsonHelper::check($view->alias_builder)) { // get the aliasFields - $alias_fields = (array) json_decode($view->alias_builder, true); + $alias_fields = (array) json_decode((string) $view->alias_builder, true); // get the active fields $alias_fields = (array) array_filter( $view->fields, function ($field) use ($alias_fields) { @@ -3343,7 +3343,7 @@ class Get // set the default data $view->default = CFactory::_('Customcode.Gui')->set( - CFactory::_('Customcode')->update(base64_decode($view->default)), + CFactory::_('Customcode')->update(base64_decode((string) $view->default)), $guiMapper ); // load context if not set @@ -3371,7 +3371,7 @@ class Get // make sure json become array if (JsonHelper::check($view->libraries)) { - $view->libraries = json_decode($view->libraries, true); + $view->libraries = json_decode((string) $view->libraries, true); } // if we have an array add it if (ArrayHelper::check($view->libraries)) @@ -3444,7 +3444,7 @@ class Get $view->main_get = $main_get[0]; // set the custom_get data $view->custom_get = $this->setGetData( - json_decode($view->custom_get, true), $view->code, $view->context + json_decode((string) $view->custom_get, true), $view->code, $view->context ); // set array adding array of scripts $addArray = array('php_view', 'php_jview', 'php_jview_display', @@ -3465,7 +3465,7 @@ class Get $guiMapper['field'] = $scripter; $view->$scripter = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($view->$scripter) + base64_decode((string) $view->$scripter) ), $guiMapper ); @@ -3473,7 +3473,7 @@ class Get else { $view->$scripter = CFactory::_('Customcode')->update( - base64_decode($view->$scripter) + base64_decode((string) $view->$scripter) ); } if (2 == $this->uikit || 1 == $this->uikit) @@ -3548,7 +3548,7 @@ class Get // check if controller input as been set $view->ajax_input = (isset($view->ajax_input) && JsonHelper::check($view->ajax_input)) - ? json_decode($view->ajax_input, true) : null; + ? json_decode((string) $view->ajax_input, true) : null; if (ArrayHelper::check($view->ajax_input)) { CFactory::_('Customcode.Dispenser')->hub[$target]['ajax_controller'][$view->code] @@ -3605,7 +3605,7 @@ class Get $guiMapper['field'] = $button_code_field; $view->{$button_code_field} = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($view->{$button_code_field}) + base64_decode((string) $view->{$button_code_field}) ), $guiMapper ); @@ -3614,7 +3614,7 @@ class Get // set the button array $view->custom_button = (isset($view->custom_button) && JsonHelper::check($view->custom_button)) - ? json_decode($view->custom_button, true) : null; + ? json_decode((string) $view->custom_button, true) : null; if (ArrayHelper::check($view->custom_button)) { $view->custom_buttons = array_values($view->custom_button); @@ -3837,7 +3837,7 @@ class Get $result->php_calculation = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($result->php_calculation) + base64_decode((string) $result->php_calculation) ), $guiMapper ); @@ -3855,7 +3855,7 @@ class Get $result->php_router_parse = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($result->php_router_parse) + base64_decode((string) $result->php_router_parse) ), $guiMapper ); @@ -3911,7 +3911,7 @@ class Get $result->{$script} = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($result->{$script}) + base64_decode((string) $result->{$script}) ), $guiMapper ); @@ -3980,7 +3980,7 @@ class Get $customQueryString = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($result->php_custom_get) + base64_decode((string) $result->php_custom_get) ), $guiMapper ); @@ -3992,7 +3992,7 @@ class Get if (StringHelper::check( $_searchQuery ) - && strpos($_searchQuery, '#__') !== false) + && strpos((string) $_searchQuery, '#__') !== false) { $_queryName = GetHelper::between( @@ -4034,7 +4034,7 @@ class Get { // set join_view_table details $result->join_view_table = json_decode( - $result->join_view_table, true + (string) $result->join_view_table, true ); if (ArrayHelper::check( $result->join_view_table @@ -4049,12 +4049,12 @@ class Get // array(on_field_as, on_field) $bucket['on_field'] = array_map( 'trim', - explode('.', $op['on_field']) + explode('.', (string) $op['on_field']) ); // array(join_field_as, join_field) $bucket['join_field'] = array_map( 'trim', - explode('.', $op['join_field']) + explode('.', (string) $op['join_field']) ); // triget filed that has table a relationship if ($op['row_type'] == 1 @@ -4133,7 +4133,7 @@ class Get unset($result->join_view_table); // set join_db_table details $result->join_db_table = json_decode( - $result->join_db_table, true + (string) $result->join_db_table, true ); if (ArrayHelper::check( $result->join_db_table @@ -4148,12 +4148,12 @@ class Get // array(on_field_as, on_field) $bucket['on_field'] = array_map( 'trim', - explode('.', $op['on_field']) + explode('.', (string) $op['on_field']) ); // array(join_field_as, join_field) $bucket['join_field'] = array_map( 'trim', - explode('.', $op['join_field']) + explode('.', (string) $op['join_field']) ); // triget filed that has table a relationship if ($op['row_type'] == 1 @@ -4233,7 +4233,7 @@ class Get unset($result->join_db_table); // set filter details $result->filter = json_decode( - $result->filter, true + (string) $result->filter, true ); if (ArrayHelper::check( $result->filter @@ -4260,7 +4260,7 @@ class Get } } // set where details - $result->where = json_decode($result->where, true); + $result->where = json_decode((string) $result->where, true); if (ArrayHelper::check( $result->where )) @@ -4283,7 +4283,7 @@ class Get unset($result->where); } // set order details - $result->order = json_decode($result->order, true); + $result->order = json_decode((string) $result->order, true); if (!ArrayHelper::check( $result->order )) @@ -4291,7 +4291,7 @@ class Get unset($result->order); } // set grouping - $result->group = json_decode($result->group, true); + $result->group = json_decode((string) $result->group, true); if (!ArrayHelper::check( $result->group )) @@ -4300,7 +4300,7 @@ class Get } // set global details $result->global = json_decode( - $result->global, true + (string) $result->global, true ); if (!ArrayHelper::check( $result->global @@ -4327,7 +4327,7 @@ class Get )) { $result->plugin_events = json_decode( - $result->plugin_events, true + (string) $result->plugin_events, true ); } else @@ -4427,15 +4427,15 @@ class Get // by id (first remove backups) $ids = $setting['ids']; // now get the ids - if (strpos($ids, ',') !== false) + if (strpos((string) $ids, ',') !== false) { $id_array = (array) array_map( - 'trim', explode(',', $ids) + 'trim', explode(',', (string) $ids) ); } else { - $id_array[] = trim($ids); + $id_array[] = trim((string) $ids); } $id_array_new = array(); // check for ranges @@ -4937,7 +4937,7 @@ class Get && StringHelper::check($row->php_view)) { $php_view = CFactory::_('Customcode.Gui')->set( - CFactory::_('Customcode')->update(base64_decode($row->php_view)), + CFactory::_('Customcode')->update(base64_decode((string) $row->php_view)), array( 'table' => $table, 'field' => 'php_view', @@ -4946,7 +4946,7 @@ class Get ); } $contnent = CFactory::_('Customcode.Gui')->set( - CFactory::_('Customcode')->update(base64_decode($row->{$table})), + CFactory::_('Customcode')->update(base64_decode((string) $row->{$table})), array( 'table' => $table, 'field' => $table, @@ -4968,7 +4968,7 @@ class Get // make sure json become array if (JsonHelper::check($row->libraries)) { - $row->libraries = json_decode($row->libraries, true); + $row->libraries = json_decode((string) $row->libraries, true); } // if we have an array add it if (ArrayHelper::check($row->libraries)) @@ -5100,7 +5100,7 @@ class Get { // build the key $k_ey = StringHelper::safe($row->alias); - $key = preg_replace("/[^A-Za-z]/", '', $k_ey); + $key = preg_replace("/[^A-Za-z]/", '', (string) $k_ey); // set the keys $this->dataWithAliasKeys[$table][$row->alias] = $row->id; $this->dataWithAliasKeys[$table][$k_ey] = $row->id; @@ -5266,7 +5266,7 @@ class Get ) && JsonHelper::check( $library->{'add' . $addTarget} - )) ? json_decode($library->{'add' . $addTarget}, true) + )) ? json_decode((string) $library->{'add' . $addTarget}, true) : null; if (ArrayHelper::check( $library->{'add' . $addTarget} @@ -5298,7 +5298,7 @@ class Get $library->addconfig = (isset($library->addconfig) && JsonHelper::check( $library->addconfig - )) ? json_decode($library->addconfig, true) : null; + )) ? json_decode((string) $library->addconfig, true) : null; if (ArrayHelper::check($library->addconfig)) { $library->config = array_map( @@ -5325,7 +5325,7 @@ class Get { $library->document = CFactory::_('Customcode.Gui')->set( CFactory::_('Customcode')->update( - base64_decode($library->php_setdocument) + base64_decode((string) $library->php_setdocument) ), array( 'table' => 'library', @@ -5342,7 +5342,7 @@ class Get $library->addconditions = (isset($library->addconditions) && JsonHelper::check( $library->addconditions - )) ? json_decode($library->addconditions, true) : null; + )) ? json_decode((string) $library->addconditions, true) : null; if (ArrayHelper::check( $library->addconditions )) @@ -5446,7 +5446,7 @@ class Get ); } // get only selected values - $lines = explode(PHP_EOL, $_string); + $lines = explode(PHP_EOL, (string) $_string); // make sure to set the string to * $string = '*'; } @@ -5615,9 +5615,9 @@ class Get if ($counter === 'a') { // the main table fields - if (strpos($table['sourcemap'], PHP_EOL) !== false) + if (strpos((string) $table['sourcemap'], PHP_EOL) !== false) { - $fields = explode(PHP_EOL, $table['sourcemap']); + $fields = explode(PHP_EOL, (string) $table['sourcemap']); if (ArrayHelper::check($fields)) { // reset array buckets @@ -5670,9 +5670,9 @@ class Get else { // the other tables - if (strpos($table['sourcemap'], PHP_EOL) !== false) + if (strpos((string) $table['sourcemap'], PHP_EOL) !== false) { - $fields = explode(PHP_EOL, $table['sourcemap']); + $fields = explode(PHP_EOL, (string) $table['sourcemap']); if (ArrayHelper::check($fields)) { // reset array buckets @@ -5887,7 +5887,7 @@ class Get $bag = $newBag; } $key = array(); - $bagsize = strlen($bag) - 1; + $bagsize = strlen((string) $bag) - 1; for ($i = 0; $i < $size; $i++) { $get = rand(0, $bagsize); @@ -6214,7 +6214,7 @@ class Get { $this->multiLangString[$string]['translation'] = json_decode( - $this->multiLangString[$string]['translation'], true + (string) $this->multiLangString[$string]['translation'], true ); } // if we have an array continue @@ -6267,7 +6267,7 @@ class Get )) { $targets = (array) json_decode( - $this->multiLangString[$string][$target], true + (string) $this->multiLangString[$string][$target], true ); // check if we should add the target ID if (in_array($target_id, $targets)) @@ -6521,7 +6521,7 @@ class Get { if (JsonHelper::check($item[$target])) { - $targets = (array) json_decode($item[$target], true); + $targets = (array) json_decode((string) $item[$target], true); // if component is not found ignore this string, and do nothing if (($key = array_search($target_id, $targets)) !== false) @@ -6557,7 +6557,7 @@ class Get )) { $other_targets = (array) json_decode( - $item[$other_target], true + (string) $item[$other_target], true ); // check if linked to other extensions if (ArrayHelper::check( @@ -6576,7 +6576,7 @@ class Get )) { $translation = json_decode( - $item['translation'], true + (string) $item['translation'], true ); if (ArrayHelper::check( $translation @@ -6873,24 +6873,24 @@ class Get $module->name, 'W' ); // set langPrefix - $this->langPrefix = 'MOD_' . strtoupper($module->code_name); + $this->langPrefix = 'MOD_' . strtoupper((string) $module->code_name); CFactory::_('Config')->set('lang_prefix', $this->langPrefix); // set lang prefix $module->lang_prefix = CFactory::_('Config')->lang_prefix; // set module class name - $module->class_helper_name = 'Mod' . ucfirst($module->code_name) + $module->class_helper_name = 'Mod' . ucfirst((string) $module->code_name) . 'Helper'; - $module->class_data_name = 'Mod' . ucfirst($module->code_name) + $module->class_data_name = 'Mod' . ucfirst((string) $module->code_name) . 'Data'; // set module install class name $module->installer_class_name = 'mod_' . ucfirst( - $module->code_name + (string) $module->code_name ) . 'InstallerScript'; // set module folder name - $module->folder_name = 'mod_' . strtolower($module->code_name); + $module->folder_name = 'mod_' . strtolower((string) $module->code_name); // set the zip name $module->zip_name = $module->folder_name . '_v' . str_replace( - '.', '_', $module->module_version + '.', '_', (string) $module->module_version ) . '__J' . CFactory::_('Config')->joomla_version; // set module file name $module->file_name = $module->folder_name; @@ -6903,14 +6903,14 @@ class Get // set some placeholder for this module CFactory::_('Placeholder')->set('Module_name', $module->official_name); CFactory::_('Placeholder')->set('Module', ucfirst( - $module->code_name + (string) $module->code_name )); CFactory::_('Placeholder')->set('module', strtolower( - $module->code_name + (string) $module->code_name )); CFactory::_('Placeholder')->set('module.version', $module->module_version); CFactory::_('Placeholder')->set('module_version', str_replace( - '.', '_', $module->module_version + '.', '_', (string) $module->module_version )); // set description (TODO) add description field to module if (!isset($module->description) @@ -6936,9 +6936,9 @@ class Get . " (v." . $module->module_version . ")
" . $module->description . "

Created by " . trim( - JFilterOutput::cleanText($component->author) + (string) JFilterOutput::cleanText($component->author) ) . "
Development started " . JFactory::getDate($module->created)->format("jS F, Y") . "

"; @@ -6951,7 +6951,7 @@ class Get if ($module->addreadme == 1 && !empty($module->readme)) { $module->readme = CFactory::_('Placeholder')->update_( - CFactory::_('Customcode')->update(base64_decode($module->readme)) + CFactory::_('Customcode')->update(base64_decode((string) $module->readme)) ); } else @@ -6962,7 +6962,7 @@ class Get // get the custom_get $module->custom_get = (isset($module->custom_get) && JsonHelper::check($module->custom_get)) - ? json_decode($module->custom_get, true) : null; + ? json_decode((string) $module->custom_get, true) : null; if (ArrayHelper::check($module->custom_get)) { $module->custom_get = $this->setGetData( @@ -6992,7 +6992,7 @@ class Get CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode( - $module->class_helper_header + (string) $module->class_helper_header ) ) ), @@ -7010,7 +7010,7 @@ class Get $module->class_helper_code = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($module->class_helper_code) + base64_decode((string) $module->class_helper_code) ) ), $guiMapper @@ -7040,7 +7040,7 @@ class Get $module->mod_code = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($module->mod_code) + base64_decode((string) $module->mod_code) ) ), $guiMapper @@ -7054,7 +7054,7 @@ class Get $module->mod_code .= PHP_EOL . "// load the default Tmpl"; $module->mod_code .= PHP_EOL . "require JModuleHelper::getLayoutPath('mod_" - . strtolower($module->code_name) + . strtolower((string) $module->code_name) . "', \$params->get('layout', 'default'));"; } // base64 Decode default header @@ -7068,7 +7068,7 @@ class Get $module->default_header = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($module->default_header) + base64_decode((string) $module->default_header) ) ), $guiMapper @@ -7088,7 +7088,7 @@ class Get $module->default = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($module->default) + base64_decode((string) $module->default) ) ), $guiMapper @@ -7111,7 +7111,7 @@ class Get // set the fields data $module->fields = (isset($module->fields) && JsonHelper::check($module->fields)) - ? json_decode($module->fields, true) : null; + ? json_decode((string) $module->fields, true) : null; if (ArrayHelper::check($module->fields)) { // ket global key @@ -7142,7 +7142,7 @@ class Get else { if ('fields_name' === $dynamic_field - && strpos($form[$dynamic_field], '.') + && strpos((string) $form[$dynamic_field], '.') !== false) { $form[$dynamic_field] @@ -7241,7 +7241,7 @@ class Get 'default="' . $old_default . '"', 'default="' . $field['custom_value'] . '"', - $field['settings']->xml + (string) $field['settings']->xml ); } else @@ -7341,7 +7341,7 @@ class Get ) && JsonHelper::check( $module->{'add' . $addTarget} - )) ? json_decode($module->{'add' . $addTarget}, true) + )) ? json_decode((string) $module->{'add' . $addTarget}, true) : null; if (ArrayHelper::check( $module->{'add' . $addTarget} @@ -7379,7 +7379,7 @@ class Get // make sure json become array if (JsonHelper::check($module->libraries)) { - $module->libraries = json_decode($module->libraries, true); + $module->libraries = json_decode((string) $module->libraries, true); } // if we have an array add it if (ArrayHelper::check($module->libraries)) @@ -7435,7 +7435,7 @@ class Get CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode( - $module->{$scriptMethod . '_' + (string) $module->{$scriptMethod . '_' . $scriptType} ) ) @@ -7458,7 +7458,7 @@ class Get && StringHelper::check($module->sql)) { $module->sql = CFactory::_('Placeholder')->update_( - CFactory::_('Customcode')->update(base64_decode($module->sql)) + CFactory::_('Customcode')->update(base64_decode((string) $module->sql)) ); } else @@ -7474,7 +7474,7 @@ class Get { $module->sql_uninstall = CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($module->sql_uninstall) + base64_decode((string) $module->sql_uninstall) ) ); } @@ -7799,10 +7799,10 @@ class Get ); // set the zip name $plugin->zip_name = $plugin->folder_name . '_v' . str_replace( - '.', '_', $plugin->plugin_version + '.', '_', (string) $plugin->plugin_version ) . '__J' . CFactory::_('Config')->joomla_version; // set plugin file name - $plugin->file_name = strtolower($plugin->code_name); + $plugin->file_name = strtolower((string) $plugin->code_name); // set plugin context $plugin->context = $plugin->folder_name . '.' . $plugin->id; // set official_name lang strings @@ -7812,14 +7812,14 @@ class Get // set some placeholder for this plugin CFactory::_('Placeholder')->set('Plugin_name', $plugin->official_name); CFactory::_('Placeholder')->set('PLUGIN_NAME', $plugin->official_name); - CFactory::_('Placeholder')->set('Plugin', ucfirst($plugin->code_name)); - CFactory::_('Placeholder')->set('plugin', strtolower($plugin->code_name)); - CFactory::_('Placeholder')->set('Plugin_group', ucfirst($plugin->group)); - CFactory::_('Placeholder')->set('plugin_group', strtolower($plugin->group)); + CFactory::_('Placeholder')->set('Plugin', ucfirst((string) $plugin->code_name)); + CFactory::_('Placeholder')->set('plugin', strtolower((string) $plugin->code_name)); + CFactory::_('Placeholder')->set('Plugin_group', ucfirst((string) $plugin->group)); + CFactory::_('Placeholder')->set('plugin_group', strtolower((string) $plugin->group)); CFactory::_('Placeholder')->set('plugin.version', $plugin->plugin_version); CFactory::_('Placeholder')->set('VERSION', $plugin->plugin_version); CFactory::_('Placeholder')->set('plugin_version', str_replace( - '.', '_', $plugin->plugin_version + '.', '_', (string) $plugin->plugin_version )); // set description CFactory::_('Placeholder')->set('DESCRIPTION', ''); @@ -7847,9 +7847,9 @@ class Get . " (v." . $plugin->plugin_version . ")
" . $plugin->description . "

Created by " . trim( - JFilterOutput::cleanText($component->author) + (string) JFilterOutput::cleanText($component->author) ) . "
Development started " . JFactory::getDate($plugin->created)->format("jS F, Y") . "

"; @@ -7862,7 +7862,7 @@ class Get if ($plugin->addreadme == 1 && !empty($plugin->readme)) { $plugin->readme = CFactory::_('Placeholder')->update_( - CFactory::_('Customcode')->update(base64_decode($plugin->readme)) + CFactory::_('Customcode')->update(base64_decode((string) $plugin->readme)) ); } else @@ -7879,7 +7879,7 @@ class Get $plugin->main_class_code = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($plugin->main_class_code) + base64_decode((string) $plugin->main_class_code) ) ), $guiMapper @@ -7894,7 +7894,7 @@ class Get $plugin->head = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($plugin->head) + base64_decode((string) $plugin->head) ) ), $guiMapper @@ -7906,7 +7906,7 @@ class Get $plugin->head = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($plugin->class_head) + base64_decode((string) $plugin->class_head) ) ), array( @@ -7924,7 +7924,7 @@ class Get $plugin->comment = CFactory::_('Customcode.Gui')->set( CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($plugin->comment) + base64_decode((string) $plugin->comment) ) ), array( @@ -7947,7 +7947,7 @@ class Get // set the fields data $plugin->fields = (isset($plugin->fields) && JsonHelper::check($plugin->fields)) - ? json_decode($plugin->fields, true) : null; + ? json_decode((string) $plugin->fields, true) : null; if (ArrayHelper::check($plugin->fields)) { // ket global key @@ -7978,7 +7978,7 @@ class Get else { if ('fields_name' === $dynamic_field - && strpos($form[$dynamic_field], '.') + && strpos((string) $form[$dynamic_field], '.') !== false) { $form[$dynamic_field] @@ -8077,7 +8077,7 @@ class Get 'default="' . $old_default . '"', 'default="' . $field['custom_value'] . '"', - $field['settings']->xml + (string) $field['settings']->xml ); } else @@ -8177,7 +8177,7 @@ class Get ) && JsonHelper::check( $plugin->{'add' . $addTarget} - )) ? json_decode($plugin->{'add' . $addTarget}, true) + )) ? json_decode((string) $plugin->{'add' . $addTarget}, true) : null; if (ArrayHelper::check( $plugin->{'add' . $addTarget} @@ -8231,7 +8231,7 @@ class Get CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( base64_decode( - $plugin->{$scriptMethod . '_' + (string) $plugin->{$scriptMethod . '_' . $scriptType} ) ) @@ -8254,7 +8254,7 @@ class Get && StringHelper::check($plugin->sql)) { $plugin->sql = CFactory::_('Placeholder')->update_( - CFactory::_('Customcode')->update(base64_decode($plugin->sql)) + CFactory::_('Customcode')->update(base64_decode((string) $plugin->sql)) ); } else @@ -8270,7 +8270,7 @@ class Get { $plugin->sql_uninstall = CFactory::_('Placeholder')->update_( CFactory::_('Customcode')->update( - base64_decode($plugin->sql_uninstall) + base64_decode((string) $plugin->sql_uninstall) ) ); } @@ -8357,7 +8357,7 @@ class Get $xml = ''; $xml .= PHP_EOL . ''; + . strtolower((string) $plugin->group) . '" method="upgrade">'; $xml .= PHP_EOL . Indent::_(1) . '' . $plugin->lang_prefix . ''; $xml .= PHP_EOL . Indent::_(1) . '' . Placefix::_h('BUILDDATE') . ''; diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 157baebbc..5fad4c0ab 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -406,11 +406,11 @@ class Structure extends Get . CFactory::_('Config')->joomla_version; $this->componentBackupName = 'com_' . $this->componentData->sales_name . '_v' . str_replace( - '.', '_', $this->componentData->component_version + '.', '_', (string) $this->componentData->component_version ) . '__J' . CFactory::_('Config')->joomla_version; $this->componentFolderName = 'com_' . $this->componentData->name_code . '_v' . str_replace( - '.', '_', $this->componentData->component_version + '.', '_', (string) $this->componentData->component_version ) . '__J' . CFactory::_('Config')->joomla_version; // set component folder path $this->componentPath = CFactory::_('Config')->get('compiler_path', JPATH_COMPONENT_ADMINISTRATOR . '/compiler') . '/' @@ -761,7 +761,7 @@ class Structure extends Get && StringHelper::check($css)) { // make sure this script does not have PHP - if (strpos($css, 'add_scripts_field = true; @@ -796,7 +796,7 @@ class Structure extends Get && StringHelper::check($javascript)) { // make sure this script does not have PHP - if (strpos($javascript, 'add_scripts_field = true; @@ -924,9 +924,9 @@ class Structure extends Get // check if we have an double fields naming set $field_name_inner = ''; $field_name_outer = $field_name; - if (strpos($field_name, '.') !== false) + if (strpos((string) $field_name, '.') !== false) { - $field_names = explode('.', $field_name); + $field_names = explode('.', (string) $field_name); if (count((array) $field_names) == 2) { $field_name_outer = $field_names[0]; @@ -1124,7 +1124,7 @@ class Structure extends Get )) { // set file name - $fileName = basename($url['url']); + $fileName = basename((string) $url['url']); // get the file contents $data = FileHelper::getContent( $url['url'] @@ -1333,9 +1333,9 @@ class Structure extends Get // check if we have an double fields naming set $field_name_inner = ''; $field_name_outer = $field_name; - if (strpos($field_name, '.') !== false) + if (strpos((string) $field_name, '.') !== false) { - $field_names = explode('.', $field_name); + $field_names = explode('.', (string) $field_name); if (count((array) $field_names) == 2) { $field_name_outer = $field_names[0]; @@ -1361,16 +1361,16 @@ class Structure extends Get if (!isset($plugin->add_rule_path[$file . $field_name . $fieldset])) { $plugin->add_rule_path[$file . $field_name . $fieldset] = - '/plugins/' . strtolower($plugin->group - ) . '/' . strtolower($plugin->code_name) + '/plugins/' . strtolower((string) $plugin->group + ) . '/' . strtolower((string) $plugin->code_name) . '/rules'; } if (!isset($plugin->add_field_path[$file . $field_name . $fieldset])) { $plugin->add_field_path[$file . $field_name . $fieldset] = - '/plugins/' . strtolower($plugin->group - ) . '/' . strtolower($plugin->code_name) + '/plugins/' . strtolower((string) $plugin->group + ) . '/' . strtolower((string) $plugin->code_name) . '/fields'; } } @@ -1515,7 +1515,7 @@ class Structure extends Get )) { // set file name - $fileName = basename($url['url']); + $fileName = basename((string) $url['url']); // get the file contents $data = FileHelper::getContent( $url['url'] @@ -1636,7 +1636,7 @@ class Structure extends Get $libFolder = strtolower( preg_replace( '/\s+/', '-', - StringHelper::safe( + (string) StringHelper::safe( $library->name, 'filename', ' ', false ) ) @@ -1660,7 +1660,7 @@ class Structure extends Get // add local folder $addLocalFolder = true; // set file name - $fileName = basename($url['url']); + $fileName = basename((string) $url['url']); // get the file contents $data = FileHelper::getContent( $url['url'] @@ -1742,10 +1742,10 @@ class Structure extends Get && StringHelper::check( $this->componentData->dashboard ) - && strpos($this->componentData->dashboard, '_') !== false) + && strpos((string) $this->componentData->dashboard, '_') !== false) { // set the default view - $getter = explode('_', $this->componentData->dashboard); + $getter = explode('_', (string) $this->componentData->dashboard); if (count((array) $getter) == 2 && is_numeric($getter[1])) { // the pointers @@ -2061,7 +2061,7 @@ class Structure extends Get $this->notNew[] = 'LICENSE.txt'; // do license check $LICENSE = false; - $licenseChecker = strtolower($this->componentData->license); + $licenseChecker = strtolower((string) $this->componentData->license); if (strpos($licenseChecker, 'gnu') !== false && strpos( $licenseChecker, '2' @@ -2097,7 +2097,7 @@ class Structure extends Get } else { - $new = str_replace($details->rename, $codeName, $item); + $new = str_replace($details->rename, $codeName, (string) $item); } } else @@ -2120,20 +2120,20 @@ class Structure extends Get { // set destination path $zipPath = str_replace( - $details->_target['type'] . '/', '', $details->path + $details->_target['type'] . '/', '', (string) $details->path ); $path = str_replace( $details->_target['type'] . '/', $this->dynamicPaths[$details->_target['key']] . '/', - $details->path + (string) $details->path ); } else { // set destination path - $zipPath = str_replace('c0mp0n3nt/', '', $details->path); + $zipPath = str_replace('c0mp0n3nt/', '', (string) $details->path); $path = str_replace( - 'c0mp0n3nt/', $this->componentPath . '/', $details->path + 'c0mp0n3nt/', $this->componentPath . '/', (string) $details->path ); } // set the template folder path @@ -2141,9 +2141,9 @@ class Structure extends Get ? (($details->custom !== 'full') ? $this->templatePathCustom . '/' : '') : $this->templatePath . '/'; // set the final paths - $currentFullPath = (preg_match('/^[a-z]:/i', $item)) ? $item + $currentFullPath = (preg_match('/^[a-z]:/i', (string) $item)) ? $item : $templatePath . '/' . $item; - $currentFullPath = str_replace('//', '/', $currentFullPath); + $currentFullPath = str_replace('//', '/', (string) $currentFullPath); $packageFullPath = str_replace('//', '/', $path . '/' . $new); $zipFullPath = str_replace( '//', '/', $zipPath . '/' . $new @@ -2545,7 +2545,7 @@ class Structure extends Get 'trim', explode( ',', - GetHelper::between( + (string) GetHelper::between( $multi_field['settings']->xml, 'fields="', '"' ) ) @@ -2578,7 +2578,7 @@ class Structure extends Get && StringHelper::check($view['settings']->created)) { // first set the main date - $date = strtotime($view['settings']->created); + $date = strtotime((string) $view['settings']->created); } else { @@ -2604,7 +2604,7 @@ class Structure extends Get && StringHelper::check($view['settings']->modified) && '0000-00-00 00:00:00' !== $view['settings']->modified) { - $date = strtotime($view['settings']->modified); + $date = strtotime((string) $view['settings']->modified); } else { @@ -2637,7 +2637,7 @@ class Structure extends Get !== $field['settings']->modified) { $anotherDate = strtotime( - $field['settings']->modified + (string) $field['settings']->modified ); if ($anotherDate > $date) { @@ -2662,7 +2662,7 @@ class Structure extends Get !== $view['settings']->main_get->modified) { $anotherDate = strtotime( - $view['settings']->main_get->modified + (string) $view['settings']->main_get->modified ); if ($anotherDate > $date) { @@ -2685,7 +2685,7 @@ class Structure extends Get !== $view['settings']->main_get->modified) { $anotherDate = strtotime( - $view['settings']->main_get->modified + (string) $view['settings']->main_get->modified ); if ($anotherDate > $date) { @@ -2745,20 +2745,20 @@ class Structure extends Get { // set destination path $path = ''; - if (strpos($details->path, 'VIEW') !== false) + if (strpos((string) $details->path, 'VIEW') !== false) { - $path = str_replace('VIEW', $name, $details->path); + $path = str_replace('VIEW', $name, (string) $details->path); } else { $path = $details->path; } // make sure we have component to replace - if (strpos($path, 'c0mp0n3nt') !== false) + if (strpos((string) $path, 'c0mp0n3nt') !== false) { - $zipPath = str_replace('c0mp0n3nt/', '', $path); + $zipPath = str_replace('c0mp0n3nt/', '', (string) $path); $path = str_replace( - 'c0mp0n3nt/', $this->componentPath . '/', $path + 'c0mp0n3nt/', $this->componentPath . '/', (string) $path ); } else @@ -2786,7 +2786,7 @@ class Structure extends Get if ($fileName) { $new = str_replace( - $details->rename, $fileName, $item + $details->rename, $fileName, (string) $item ); $name = $name . '_' . $fileName; } @@ -2797,7 +2797,7 @@ class Structure extends Get else { $new = str_replace( - $details->rename, $name, $item + $details->rename, $name, (string) $item ); } } @@ -2849,7 +2849,7 @@ class Structure extends Get if (File::exists($custom_settings)) { $version_data = json_decode( - FileHelper::getContent( + (string) FileHelper::getContent( $custom_settings ) ); @@ -2857,7 +2857,7 @@ class Structure extends Get else { $version_data = json_decode( - FileHelper::getContent( + (string) FileHelper::getContent( $this->templatePath . '/settings.json' ) ); @@ -2938,7 +2938,7 @@ class Structure extends Get if (isset($custom['path']) && StringHelper::check($custom['path'])) { - $custom['path'] = trim($custom['path'], '/'); + $custom['path'] = trim((string) $custom['path'], '/'); } // by default custom path is true $customPath = 'custom'; @@ -2961,14 +2961,14 @@ class Structure extends Get $customPath = 'full'; } // make sure we use the correct name - $pathArray = (array) explode('/', $custom['path']); + $pathArray = (array) explode('/', (string) $custom['path']); $firstFolder = array_values($pathArray)[0]; $lastFolder = end($pathArray); // only rename folder if last has folder name if (isset($custom['rename']) && $custom['rename'] == 1) { $custom['path'] = str_replace( - '/' . $lastFolder, '', $custom['path'] + '/' . $lastFolder, '', (string) $custom['path'] ); $rename = 'new'; $newname = $lastFolder; @@ -2976,7 +2976,7 @@ class Structure extends Get elseif ('full' === $customPath) { // make sure we use the correct name - $folderArray = (array) explode('/', $custom['folder']); + $folderArray = (array) explode('/', (string) $custom['folder']); $lastFolder = end($folderArray); $rename = 'new'; $newname = $lastFolder; @@ -2993,12 +2993,12 @@ class Structure extends Get ) . '_f' . $pointer_tracker; $pointer_tracker++; // fix custom path - $custom['path'] = ltrim($custom['path'], '/'); + $custom['path'] = ltrim((string) $custom['path'], '/'); // set new folder to object $version_data->move->static->{$key_pointer} = new stdClass(); $version_data->move->static->{$key_pointer}->naam = str_replace( - '//', '/', $custom['folder'] + '//', '/', (string) $custom['folder'] ); $version_data->move->static->{$key_pointer}->path = $_target_type @@ -3084,14 +3084,14 @@ class Structure extends Get // set new file to object $version_data->move->static->{$key_pointer} = new stdClass(); $version_data->move->static->{$key_pointer}->naam = str_replace( - '//', '/', $custom['file'] + '//', '/', (string) $custom['file'] ); // update the dynamic component name placholders in file names $custom['path'] = CFactory::_('Placeholder')->update_( $custom['path'] ); // get the path info - $pathInfo = pathinfo($custom['path']); + $pathInfo = pathinfo((string) $custom['path']); if (isset($pathInfo['extension']) && $pathInfo['extension']) { $pathInfo['dirname'] = trim($pathInfo['dirname'], '/'); @@ -3106,9 +3106,9 @@ class Structure extends Get elseif ('full' === $customPath) { // fix custom path - $custom['path'] = ltrim($custom['path'], '/'); + $custom['path'] = ltrim((string) $custom['path'], '/'); // get file array - $fileArray = (array) explode('/', $custom['file']); + $fileArray = (array) explode('/', (string) $custom['file']); // set the info $version_data->move->static->{$key_pointer}->path = $_target_type @@ -3121,7 +3121,7 @@ class Structure extends Get else { // fix custom path - $custom['path'] = ltrim($custom['path'], '/'); + $custom['path'] = ltrim((string) $custom['path'], '/'); // set the info $version_data->move->static->{$key_pointer}->path = $_target_type diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 90dd80960..cf9208352 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -1956,9 +1956,9 @@ class Fields extends Structure $optionSet = ''; if (strtolower($typeName) === 'groupedlist' && strpos( - $value, ',' + (string) $value, ',' ) !== false - && strpos($value, '@@') !== false) + && strpos((string) $value, '@@') !== false) { // reset the group temp arrays $groups_ = array(); @@ -1966,7 +1966,7 @@ class Fields extends Structure 'option' => array()); $order_ = array(); // mulitpal options - $options = explode(',', $value); + $options = explode(',', (string) $value); foreach ($options as $option) { if (strpos($option, '@@') !== false) @@ -2106,10 +2106,10 @@ class Fields extends Structure } } } - elseif (strpos($value, ',') !== false) + elseif (strpos((string) $value, ',') !== false) { // mulitpal options - $options = explode(',', $value); + $options = explode(',', (string) $value); foreach ($options as $option) { if (strpos($option, '|') !== false) @@ -2156,10 +2156,10 @@ class Fields extends Structure else { // one option - if (strpos($value, '|') !== false) + if (strpos((string) $value, '|') !== false) { // has other value then text - list($v, $t) = explode('|', $value); + list($v, $t) = explode('|', (string) $value); $langValue = $langView . '_' . FieldHelper::safe( $t, true @@ -2283,11 +2283,11 @@ class Fields extends Structure $field .= PHP_EOL . Indent::_(4) . '