From 8cf257df657c944d83c82c6823659d8b03971d99 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be>
Date: Wed, 14 Sep 2016 13:23:36 +0200
Subject: [PATCH] Fixes #5149 Using PHP_SELF if PATH_INFO is empty or not set

---
 html/class_passwordRecovery.inc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/html/class_passwordRecovery.inc b/html/class_passwordRecovery.inc
index 706f73eb8..eae7d5d9a 100644
--- a/html/class_passwordRecovery.inc
+++ b/html/class_passwordRecovery.inc
@@ -194,7 +194,11 @@ class standAlonePage {
     if ($port != '80') {
       $pageURL .= ':'.$port;
     }
-    $pageURL .= $_SERVER['PATH_INFO'];
+    if (empty($_SERVER['PATH_INFO'])) {
+      $pageURL .= $_SERVER['PHP_SELF'];
+    } else {
+      $pageURL .= $_SERVER['PATH_INFO'];
+    }
 
     return $pageURL;
   }
-- 
GitLab