Commit 1919764b authored by Johan Cwiklinski's avatar Johan Cwiklinski Committed by Johan Cwiklinski

Fix redirect (#5757)

parent 981aa912
......@@ -1837,7 +1837,7 @@ class Toolbox {
if (Session::getCurrentInterface()) {
$decoded_where = rawurldecode($where);
// redirect to URL : URL must be rawurlencoded
if ($link = preg_match('/(https?:\/\/[^\/]+)\/.+/', $decoded_where, $matches)) {
if (preg_match('@(([^:/].+:)?//[^/]+)(/.+)?@', $decoded_where, $matches)) {
if ($matches[1] !== $CFG_GLPI['url_base']) {
Session::addMessageAfterRedirect('Redirection failed');
if (Session::getCurrentInterface() === "helpdesk") {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment