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/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',