Merge remote-tracking branch 'upstream/main' into main

This commit is contained in:
konkon-fox 2023-11-04 22:13:35 +09:00
commit 69588fd2e8
4 changed files with 43 additions and 8 deletions

View File

@ -1,21 +1,49 @@
<?php
// 汎用ブラウザ識別文字列
$BROWSERS = ['Gecko', 'AppleWebKit', 'Chrome'];
$CLIENT_UA = $_SERVER['HTTP_USER_AGENT'];
$isUtf8 = false;
if (stripos($CLIENT_UA, 'Monazilla') === false) {
foreach ($BROWSERS as $UA) {
if (stripos($CLIENT_UA, $UA) !== false) {
$isUtf8 = true;
break;
}
}
}
// UTF-8
if ($isUtf8 === true) {
$charset = 'utf-8';
$bbsTitle = $BBS_TITLE_UTF8;
header('Content-type: text/html; charset=UTF-8');
}
// Shift_JIS
else {
$charset = 'shift_jis';
$bbsTitle = $BBS_TITLE_SJIS;
header('Content-type: text/html; charset=Shift_JIS');
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta charset="<?= $charset ?>">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<meta name="application-name" content="delight">
<meta name="application-name" content="delightly">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="../icon.png">
<link rel="icon" href="../favicon.ico">
<meta name="referrer" content="origin">
<title><BBS></title>
<title><?= $bbsTitle ?></title>
</head>
<body>
<table width="95%" cellspacing="7" cellpadding="3" border="1" bgcolor="#CCFFCC" align="center"><tbody><tr><td align="center">
<table width="100%" cellpadding="1" border="0">
<tbody><tr>
<td><font size="+1"><b><BBS></b></font></td>
<td><font size="+1"><b><?= $bbsTitle ?></b></font></td>
<td width="5%" valign="top" nowrap="" align="right"><a href="#menu"></a> <a href="#t-1"></a></td>
</tr>
<tr><td colspan="3"><noscript><p>JavaScriptを有効にしてください<br>Please turn on your JavaScript</p></noscript></td></tr>

View File

@ -6,7 +6,7 @@ $code = @file_get_contents($file);
?><!DOCTYPE HTML>
<html lang="ja">
<head>
<meta charset=UTF-8">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>新規掲示板作成</title>
<link href="/static/a.css" rel="stylesheet" type="text/css">

View File

@ -26,9 +26,10 @@ if (file_exists("../".$_POST['directory'])) {
@file_put_contents("../".$_POST['directory']."/passfile.cgi", $password);
$htaccess = '<Files ~ "\.cgi$">'."\n".'deny from all'."\n".'</Files>';
@file_put_contents("../".$_POST['directory']."/.htaccess", $htaccess);
$index = @file_get_contents("../".$_POST['directory']."/index.html");
$index = str_replace("<BBS>", $_POST['directory'], $index);
@file_put_contents("../".$_POST['directory']."/index.html", $index);
// index.phpの置換
$utf8 = $sjis = $_POST['directory'];
file_put_contents("../".$_POST['directory']."/index.php", "<?php \$BBS_TITLE_UTF8 = \"{$utf8}\";\$BBS_TITLE_SJIS = \"{$sjis}\";include \"../test/board/index.php\";?>");
header('Location: ../'.$_POST['directory'].'/');
exit;
}else Finish("新規掲示板作成に失敗しました");

View File

@ -4,8 +4,14 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['edit'] == "yes") {
if (isset($_POST[$name])) $SETTING[$name] = $_POST[$name];
$SET .= $name."=".$SETTING[$name]."\n";
}
mb_substitute_character('entity');
file_put_contents($setfile, json_encode($SETTING, JSON_UNESCAPED_UNICODE), LOCK_EX);
file_put_contents($settxt, mb_convert_encoding($SET, "SJIS-win", "UTF-8"), LOCK_EX);
$utf8 = $SETTING["BBS_TITLE"];
$sjis = mb_convert_encoding($SETTING["BBS_TITLE"], "SJIS-win", "UTF-8");
file_put_contents($PATH."index.php", "<?php \$BBS_TITLE_UTF8 = \"{$utf8}\";\$BBS_TITLE_SJIS = \"{$sjis}\";include \"../test/board/index.php\";?>");
}
?>
<!DOCTYPE html>