0, 'err' => LOC_ERROR_HOZON_NI_SIPPAI]; } return ['code' => 1, 'url' => $url.'/'.geturl()]; } function striptags (string $text): string { $text = preg_replace('/\/', '', $text); $text = preg_replace('/\/', '', $text); $text = preg_replace('/\.css\?/', '.css@', $text); //$text = preg_replace('/'.parse_url($_POST['hozonsite'])['scheme'].'\:\/\/(.*)'.parse_url($_POST['hozonsite'])['host'].'/', '', $text); $text = preg_replace('/visibility: hidden/', '', $text); $text = preg_replace('/\
[\s\S]+?\<\/div\>/', '', $text); $text = preg_replace('/\
[\s\S]+?\<\/div\>/', '', $text); $text = preg_replace('/(https\:\/\/)(.*)\//', '/', $text); $allowed = [ '!doctype', 'a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', /*'audio',*/ 'b', 'base', 'basefont', 'bb', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datagrid', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'eventsource', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', /*'html',*/ 'i', /*'iframe',*/ 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', /*'script',*/ 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'tt', 'u', 'ul', 'var', /*'video',*/ 'wbr' ]; return strip_tags($text, $allowed); } function sanitize_archive ($path) { $file = file_get_contents(urldecode($path)); // ファイルの開く $file = striptags($file); // 危険なタグの削除 // ヘッダーの追加 $file = "
".SITE_NAME_JA."でアーカイブしました。Archived with ".SITE_NAME_EN.".
トップページへ To toppage
".$file.'
'; // 保存 file_put_contents(urldecode($path), $file); } if (count($_POST) > 0) { // HTTPかHTTPSじゃない場合 if (!str_starts_with($_POST['hozonsite'], 'https://') && !str_starts_with($_POST['hozonsite'], 'http://')) { $err = LOC_ERROR_URL_HTTP_HTTPS; } else { $url = geturl(); $fullurl = 'archive/'.time(); $exists = glob('archive/*/'.$url); if ($exists) { $tmp = []; foreach ($exists as $k => $v) { $tmp[$k] = explode('/', $v)[1]; } $exists = $tmp; unset($tmp); } if (count($exists) == 0 || (count($exists) > 0 && isset($_POST['agree']))) { if (!mkdir('./'.$fullurl, 0755, true)) die(LOC_ERROR_KYOKA); // ダイレクトリーを作成出来なければ、死ね $url = archiving('./'.$fullurl); // ウエブページのダウンロード if ($url['code'] == 0) { $err = $url['err']; } else { $url = $url['url']; sanitize_archive($url); // 危険なタグの削除 header('Location: '.$url); // 移転 die(); } } } } ?> <?= $lang == 'en' ? SITE_NAME_EN : SITE_NAME_JA ?>

<?= LOC_LOGO; ?>

|


0 && count($exists) > 0) { ?>


'.date('Y年m月d日 H:i:s', $e).''; echo "
"; } ?>