detectportal/public/index.php
2021-07-19 22:09:55 +02:00

18 lines
514 B
PHP

<?php
if ($_SERVER['REDIRECT_URL']=='/ip'){
print($_SERVER['REMOTE_ADDR']);
die("\n");
}
$ua = $_SERVER['HTTP_USER_AGENT'];
if ($_SERVER['REDIRECT_URL']=='/ua'){
print($ua);
die("\n");
}
$slash = strrchr($ua,'/');
$ffversion = intval(substr($slash,1));
if ($ffversion >= 89){
die('<meta http-equiv="refresh" content="0;url=https://support.mozilla.org/kb/captive-portal"/>');
} else {
die('success');
}
// Source: https://www.encrypted.at/firefox-captive-portal-url/