From 17d2bf8fbbe553e24dd886439405a6d5346ce4c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Wed, 28 Dec 2022 17:06:10 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=82=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/langchange.php | 10 ++++++++++ www/index.php | 18 +++++++----------- 2 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 src/langchange.php diff --git a/src/langchange.php b/src/langchange.php new file mode 100644 index 0000000..91ee9fc --- /dev/null +++ b/src/langchange.php @@ -0,0 +1,10 @@ + diff --git a/www/index.php b/www/index.php index 388a3db..78d734c 100644 --- a/www/index.php +++ b/www/index.php @@ -1,13 +1,5 @@ 0, 'err' => LOC_ERROR_HOZON_NI_SIPPAI]; } @@ -51,9 +43,13 @@ 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', @@ -87,7 +83,7 @@ $file = striptags($file); // 危険なタグの削除 // ヘッダーの追加 - $file = "
".SITE_NAME_JA."でアーカイブしました。Archived with ".SITE_NAME_EN.".
トップページへ To toppage
".$file.'
'; + $file = "
".SITE_NAME_JA."でアーカイブしました。Archived with ".SITE_NAME_EN.".
トップページへ To toppage
".$file.'
'; // 保存 file_put_contents(urldecode($path), $file);