From 241bd1cdeb3119151e35cac1c09fdee086d5277f Mon Sep 17 00:00:00 2001 From: bruno-ds Date: Mon, 22 Feb 2021 09:42:24 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B03430=20-=20code=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - during the code review @dflaven preferred the reference rather than the return alternative - typo --- .../itop-portal-base/portal/src/Form/ObjectFormManager.php | 4 +--- dictionaries/en.dictionary.itop.ui.php | 2 +- sources/form/formmanager.class.inc.php | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php index 88d434496..d93f3debd 100644 --- a/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php +++ b/datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php @@ -1051,7 +1051,7 @@ class ObjectFormManager extends FormManager /** * @inheritDoc */ - public function CheckTransaction($aData) + public function CheckTransaction(&$aData) { $isTransactionValid = \utils::IsTransactionValid($this->oForm->GetTransactionId(), false); //The transaction token is kept in order to preserve BC with ajax forms (the second call would fail if the token is deleted). (The GC will take care of cleaning the token for us later on) if (!$isTransactionValid) { @@ -1066,8 +1066,6 @@ class ObjectFormManager extends FormManager ]; $aData['valid'] = false; } - - return $aData; } /** diff --git a/dictionaries/en.dictionary.itop.ui.php b/dictionaries/en.dictionary.itop.ui.php index 66c9c78bb..5d4a4215f 100644 --- a/dictionaries/en.dictionary.itop.ui.php +++ b/dictionaries/en.dictionary.itop.ui.php @@ -465,7 +465,7 @@ Dict::Add('EN US', 'English', 'English', array( 'UI:Error:InvalidDashboard' => 'Error: invalid dashboard', 'UI:Error:MaintenanceMode' => 'Application is currently in maintenance', 'UI:Error:MaintenanceTitle' => 'Maintenance', - 'UI:Error:InvalidToken' => 'Error: the requested operation have already been performed (CSRF token not found)', + 'UI:Error:InvalidToken' => 'Error: the requested operation has already been performed (CSRF token not found)', 'UI:GroupBy:Count' => 'Count', 'UI:GroupBy:Count+' => 'Number of elements', diff --git a/sources/form/formmanager.class.inc.php b/sources/form/formmanager.class.inc.php index cb6e15f2d..4d87b6a23 100644 --- a/sources/form/formmanager.class.inc.php +++ b/sources/form/formmanager.class.inc.php @@ -175,7 +175,7 @@ abstract class FormManager ), ); - $aData = $this->CheckTransaction($aData); + $this->CheckTransaction($aData); return $aData; } @@ -187,7 +187,7 @@ abstract class FormManager * * @since 2.7.4 3.0.0 N°3430 */ - public function CheckTransaction($aData) + public function CheckTransaction(&$aData) { $isTransactionValid = \utils::IsTransactionValid($this->oForm->GetTransactionId(), false); //The transaction token is kept in order to preserve BC with ajax forms (the second call would fail if the token is deleted). (The GC will take care of cleaning the token for us later on) if (!$isTransactionValid) { @@ -196,8 +196,6 @@ abstract class FormManager ]; $aData['valid'] = false; } - - return $aData; } /**