Skip to content

Commit

Permalink
fix(issue): prevent php warings with incorrect url
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jan 26, 2022
1 parent edfacd9 commit 972dc40
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ function plugin_formcreator_registerClasses() {
}

function plugin_formcreator_redirect() {
global $CFG_GLPI;

if (!isset($_SESSION['glpiactiveentities_string'])) {
return;
}
Expand Down Expand Up @@ -422,9 +424,15 @@ function plugin_formcreator_redirect() {
if (isset($_GET['_openfollowup'])) {
$openItilFollowup = '&_openfollowup=1';
}
parse_str($_SERVER['QUERY_STRING'], $decodedUrl);
if (isset($decodedUrl['forcetab'])) {
Session::setActiveTab(Ticket::class, $decodedUrl['forcetab']);
if (isset($_SERVER['QUERY_STRING'])) {
parse_str($_SERVER['QUERY_STRING'], $decodedUrl);
if (isset($decodedUrl['forcetab'])) {
Session::setActiveTab(Ticket::class, $decodedUrl['forcetab']);
}
}
if (!isset($_GET['id'])) {
// invalid url
Html::redirect($CFG_GLPI["root_doc"]);
}

// When an ticket has a matching issue (it means that the ticket is the only generated ticket)
Expand Down

0 comments on commit 972dc40

Please sign in to comment.