From 1baf2262e262e3a80877f8600b332838670883dc Mon Sep 17 00:00:00 2001 From: Nobuhiro YASUTOMI Date: Fri, 27 Oct 2023 11:49:35 +0900 Subject: [PATCH] XOOPS_URL: allow protocol part to be omitted --- html/include/functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/include/functions.php b/html/include/functions.php index efba6303b..565c633e9 100644 --- a/html/include/functions.php +++ b/html/include/functions.php @@ -158,6 +158,8 @@ function xoops_refcheck($docheck=1) if ($ref === '') { return false; } + // Allow protocol part to be omitted + if (substr(XOOPS_URL, 0, 1)==='/') $ref = preg_replace('/^https?:/', '', $ref); //TODO PHP8 'strpos' call can be converted to 'str_starts_with' if (strpos($ref, (string) XOOPS_URL) !== 0) { return false;