Created
December 23, 2020 13:54
-
-
Save bernard-ng/ad5fa5bc7ef2c6045a9b3c586464d5df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function validRequest(): bool { | |
$myDomain = $_SERVER['SCRIPT_URI']; | |
$requestsSource = $_SERVER['HTTP_REFERER']; | |
return parse_url($myDomain, PHP_URL_HOST) === parse_url($requestsSource, PHP_URL_HOST); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment