Skip to content

Commit 5832f27

Browse files
committed
禁止ホストには管理者ログイン画面を表示しない。
1 parent d67f3f3 commit 5832f27

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

petitnote/functions.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@ function is_adminpass($pwd): bool {
127127
}
128128

129129
function admin_in(): void {
130-
131130
global $boardname,$use_diary,$use_aikotoba,$petit_lot,$petit_ver,$skindir,$en,$latest_var;
132131

132+
if(is_badhost()){
133+
error($en? 'Rejected.' : '拒絶されました。');
134+
}
135+
133136
aikotoba_required_to_view();
134137

135138
//古いテンプレート用の使用しない変数

petitnote/index.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
//Petit Note (c)さとぴあ @satopian 2021-2025
33
//1スレッド1ログファイル形式のスレッド式画像掲示板
4-
$petit_ver='v1.89.0';
4+
$petit_ver='v1.89.2';
55
$petit_lot='lot.20250602';
66

77
$lang = ($http_langs = $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '')
@@ -766,7 +766,7 @@ function paint(): void {
766766
global $usercode,$petit_lot,$httpsonly,$is_badhost;
767767

768768
if(is_badhost()){
769-
error($en?'Post was rejected.':'拒絶されました。');
769+
error($en? 'Rejected.' : '拒絶されました。');
770770
}
771771

772772
check_same_origin();
@@ -1099,7 +1099,7 @@ function to_continue(): void {
10991099

11001100
$is_badhost=is_badhost();//テンプレートの互換性のため変数名が必要
11011101
if($is_badhost){
1102-
error($en?'Post was rejected.':'拒絶されました。');
1102+
error($en? 'Rejected.' : '拒絶されました。');
11031103
}
11041104

11051105
aikotoba_required_to_view(true);
@@ -2358,8 +2358,8 @@ function view(): void {
23582358
$index_cache_json = __DIR__.'/template/cache/index_cache.json';
23592359

23602360
$out=[];
2361-
if($page===0 && !$admindel && !$userdel && !$adminpost){
2362-
$out = (!$is_badhost && is_file($index_cache_json)) ? json_decode(file_get_contents($index_cache_json),true) : [];
2361+
if($page===0 && !$admindel && !$userdel && !$adminpost && !$is_badhost){
2362+
$out = is_file($index_cache_json) ? json_decode(file_get_contents($index_cache_json),true) : [];
23632363
}
23642364
if(empty($out)){
23652365
//oyaのループ
@@ -2438,7 +2438,7 @@ function view(): void {
24382438
$next=(($page+$pagedef)<$count_alllog) ? $page+$pagedef : false;//ページ番号がmaxを超える時はnextのリンクを出さない
24392439
$prev=((int)$page<=0) ? false : ($page-$pagedef);//ページ番号が0の時はprevのリンクを出さない
24402440
$prev=($prev<0) ? 0 : $prev;
2441-
if($page===0 && !$admindel && !$adminpost){
2441+
if($page===0 && !$admindel && !$adminpost && !$is_badhost){
24422442
if(!is_file($index_cache_json)){
24432443
file_put_contents($index_cache_json,json_encode($out),LOCK_EX);
24442444
chmod($index_cache_json,0600);

0 commit comments

Comments
 (0)