From 2fcc0791aca52101ae59c7d7f79e9935e1c39a7a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Sep 2020 19:55:44 +0200 Subject: [PATCH] Fix regression on backtopage --- htdocs/core/lib/functions.lib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7c314c08be1..18c0558b465 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -561,7 +561,8 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null // Sanitizing for special parameters. There is no reason to allow the backtopage parameter to contains an external URL. if ($paramname == 'backtopage') { - $out = preg_replace(array('!(\\\|/)+!', '/^[a-z]*:/'), '', $out); + $out = str_replace('\\', '/', $out); + $out = preg_replace(array('/^\/\/+/', '/^[a-z]*:/i'), '', $out); } // Code for search criteria persistence.