Skip to content

Commit

Permalink
Merge pull request #298 from nbuy/referer_url_check
Browse files Browse the repository at this point in the history
XOOPS_URL: allow protocol part to be omitted
  • Loading branch information
gigamaster authored Nov 1, 2023
2 parents 1f091e6 + 1baf226 commit 30b2f80
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 30b2f80

Please sign in to comment.