From 2611177527fc6db8c9de5b333ff9d504bd939200 Mon Sep 17 00:00:00 2001 From: sota_miyamoto Date: Mon, 23 Aug 2021 16:55:34 +0900 Subject: [PATCH 1/2] =?UTF-8?q?#261=20=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95?= =?UTF-8?q?=E3=83=AD=E3=83=BC=E3=81=A7=E5=80=A4=E3=82=92=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=81=A8=E6=9B=B4=E6=96=B0=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=81=8C=E3=82=B7=E3=82=B9=E3=83=86=E3=83=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E8=80=85=E3=81=AB=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit a8bf3aa89c615230b01b4c9af151f528db13193a) --- modules/com_vtiger_workflow/VTWorkflowUtils.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/com_vtiger_workflow/VTWorkflowUtils.php b/modules/com_vtiger_workflow/VTWorkflowUtils.php index f671da0e2..8da81f93a 100644 --- a/modules/com_vtiger_workflow/VTWorkflowUtils.php +++ b/modules/com_vtiger_workflow/VTWorkflowUtils.php @@ -65,8 +65,12 @@ function loggedInUser() { */ function revertUser() { global $current_user; - if (count(self::$userStack) != 0) { - $current_user = array_pop(self::$userStack); + $userStackCounts = count(self::$userStack); + if ($userStackCounts != 0) { + for ($i=1; $i<$userStackCounts; $i++) { + array_pop(self::$userStack); + } + $current_user = self::$userStack[0]; } else { $current_user = null; } From 4dc6960d2587d522b871e703ddc2d319b9fe6fc5 Mon Sep 17 00:00:00 2001 From: sota_miyamoto Date: Mon, 23 Aug 2021 17:43:49 +0900 Subject: [PATCH 2/2] =?UTF-8?q?#261=20array=5Fsplice=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=A3=E3=81=9F=E5=87=A6=E7=90=86=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0bd517b53bf7508deebcd349b4b01bbe6b6aac66) --- modules/com_vtiger_workflow/VTWorkflowUtils.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/com_vtiger_workflow/VTWorkflowUtils.php b/modules/com_vtiger_workflow/VTWorkflowUtils.php index 8da81f93a..2057543d4 100644 --- a/modules/com_vtiger_workflow/VTWorkflowUtils.php +++ b/modules/com_vtiger_workflow/VTWorkflowUtils.php @@ -65,11 +65,8 @@ function loggedInUser() { */ function revertUser() { global $current_user; - $userStackCounts = count(self::$userStack); - if ($userStackCounts != 0) { - for ($i=1; $i<$userStackCounts; $i++) { - array_pop(self::$userStack); - } + if (count(self::$userStack) != 0) { + array_splice(self::$userStack, 1); $current_user = self::$userStack[0]; } else { $current_user = null;