Skip to content

Commit

Permalink
XOOPS_URL: allow protocol part to be omitted
Browse files Browse the repository at this point in the history
  • Loading branch information
nbuy committed Oct 27, 2023
1 parent fc673c1 commit 1baf226
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions html/include/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1baf226

Please sign in to comment.