X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FNetwork.php;h=0b10687c9d5a64f3a5e8ceef166d04002cec7293;hb=dee1899628380998d3a284e41bfc49ce0737dd2f;hp=6694fd4f0c057f3fad686824233334457bf5957a;hpb=fc2340d4afe6466c58e35afd64fe9010bf185b04;p=friendica.git diff --git a/src/Util/Network.php b/src/Util/Network.php index 6694fd4f0c..0b10687c9d 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -1,6 +1,6 @@ get('system', 'no_redirect_list', []); + if (!$no_redirect_list) { + return false; + } + + foreach ($no_redirect_list as $no_redirect) { + if (fnmatch(strtolower($no_redirect), strtolower($host))) { + return true; + } + } + + return false; + } + /** * Check if email address is allowed to register here. * @@ -519,4 +548,15 @@ class Network exit; } } + + /** + * Check if the given URL is a local link + * + * @param string $url + * @return bool + */ + public static function isLocalLink(string $url) + { + return (strpos(Strings::normaliseLink($url), Strings::normaliseLink(DI::baseUrl())) !== false); + } }