移転されているURLチェック
このコミットが含まれているのは:
コミット
595eaef66b
10
helper.php
10
helper.php
|
@ -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.';
|
||||
}
|
||||
|
||||
|
|
新しいイシューから参照