移転されているURLチェック

このコミットが含まれているのは:
守矢諏訪子 2022-06-05 02:40:34 +09:00
コミット 595eaef66b
1個のファイルの変更9行の追加1行の削除

ファイルの表示

@ -34,13 +34,21 @@
$err[] = 'このドメイン名は未登録みたいです。<br />This domain name seems to be unregistered.';
}
// ウエブページが移転されているかどうか
if (
(int)trim(shell_exec('curl -o /dev/null -s -w "%{http_code}\n" '.$url.' 2>&1') >= 301) &&
(int)trim(shell_exec('curl -o /dev/null -s -w "%{http_code}\n" '.$url.' 2>&1') <= 399)
) {
$err[] = 'ウェブサイトは移転されているみたいです。直接URLをご入力下さい。<br />The website seems to have been relocated. Please enter the URL directly.';
}
// ブラフレを使っているかどうかチェック
if (!is_null(shell_exec('whois '.get_domain($url).' | grep -i "cloudflare" 2>&1'))) {
$err[] = 'ウェブサイトはCloudFlareを使っているみたいです。追加依頼拒否。<br />The website seems to be using CloudFlare. Rejection of additional request.';
}
// Torブロックのチェック
if (!is_null(shell_exec('torsocks curl -s -L '.$url.' | grep "Please stand by, while we are checking your browser...\|We are checking your browser...\|Ray ID|HTTP 429 Too Many Requests" 2>&1'))) {
if ((int)trim(shell_exec('torsocks curl -o /dev/null -s -w "%{http_code}\n" '.$url.' 2>&1') >= 400)) {
$err[] = 'ウェブサイトはTorで接続出来ないみたいです。追加依頼拒否。<br />The website doesn\'t seem to be able to connect with Tor. Rejection of additional request.';
}