From effe79664c0982150193d089e832f7c7ea229f47 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Tue, 23 Jan 2024 22:17:32 +0100 Subject: [PATCH] Fix navigation page after table edit Signed-off-by: Kamil Tekiela --- libraries/classes/InsertEdit.php | 2 +- psalm-baseline.xml | 12 ++++++------ test/classes/InsertEditTest.php | 7 +++++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libraries/classes/InsertEdit.php b/libraries/classes/InsertEdit.php index 3ef0dc9e8a..e88946a6a1 100644 --- a/libraries/classes/InsertEdit.php +++ b/libraries/classes/InsertEdit.php @@ -1245,7 +1245,7 @@ class InsertEdit if (! preg_match('@^[a-z_]+\.php$@', $GLOBALS['goto'])) { // this should NOT happen //$GLOBALS['goto'] = false; - if ($GLOBALS['goto'] === 'index.php?route=/sql') { + if (str_contains($GLOBALS['goto'], 'index.php?route=/sql')) { $gotoInclude = '/sql'; } else { $gotoInclude = false; diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6fdeed3ccb..fde56a20c9 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -3056,14 +3056,9 @@ - - $rows + $start - - $_REQUEST['pos'] - $_REQUEST['session_max_rows'] - $db $db @@ -3079,6 +3074,11 @@ $url_params['db'] + + $_REQUEST['pos'] + $_REQUEST['session_max_rows'] + $rows + $_REQUEST['pos'] $_REQUEST['pos'] diff --git a/test/classes/InsertEditTest.php b/test/classes/InsertEditTest.php index d108393352..b6db4bf505 100644 --- a/test/classes/InsertEditTest.php +++ b/test/classes/InsertEditTest.php @@ -1884,6 +1884,13 @@ class InsertEditTest extends AbstractTestCase $this->assertEquals('', $GLOBALS['table']); + $GLOBALS['goto'] = 'index.php?route=/sql&server=2'; + + $this->assertEquals( + '/sql', + $this->insertEdit->getGotoInclude('index') + ); + $_POST['after_insert'] = 'new_insert'; $this->assertEquals( '/table/change',