Procházet zdrojové kódy

Merge pull request #95 from tomamplius/fix-82

Fix redirect (#82)
Eduardo Mozart de Oliveira před 1 rokem
rodič
revize
9133eabe72
2 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 2 2
      front/callback.php
  2. 2 2
      inc/provider.class.php

+ 2 - 2
front/callback.php

@@ -92,8 +92,8 @@ if ($user_id || $signon_provider->login()) {
 
 
    if (isset($params['redirect'])) {
    if (isset($params['redirect'])) {
       $REDIRECT = '?redirect=' . $params['redirect'];
       $REDIRECT = '?redirect=' . $params['redirect'];
-   } else if (isset($_GET['state']) && is_integer(strpos($_GET['state'], "&redirect="))) {
-      $REDIRECT = '?' . substr($_GET['state'], strpos($_GET['state'], "&redirect=") + 1);
+   } else if (isset($_GET['state']) && is_integer(strpos($_GET['state'], ";redirect="))) {
+      $REDIRECT = '?' . substr($_GET['state'], strpos($_GET['state'], ";redirect=") + 1);
    }
    }
 
 
    if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
    if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {

+ 2 - 2
inc/provider.class.php

@@ -914,8 +914,8 @@ class PluginSinglesignonProvider extends CommonDBTM {
          exit;
          exit;
       }
       }
 
 
-      if (isset($_GET['state']) && is_integer(strpos($_GET['state'], "&redirect="))) {
-         $pos_redirect  = strpos($_GET['state'], "&redirect=");
+      if (isset($_GET['state']) && is_integer(strpos($_GET['state'], ";redirect="))) {
+         $pos_redirect  = strpos($_GET['state'], ";redirect=");
          $state         = substr($_GET['state'], 0, $pos_redirect);
          $state         = substr($_GET['state'], 0, $pos_redirect);
          $_GET['state'] = substr($_GET['state'], $pos_redirect);
          $_GET['state'] = substr($_GET['state'], $pos_redirect);
       } else {
       } else {