File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 130130// 禁止ホスト
131131$ badhost =["example.com " ,"example.org " ];
132132
133+ //ホスト名が逆引きできないIPアドレスからの投稿を拒絶する
134+ // する: true しない: false
135+
136+ // $reject_if_no_reverse_dns = true;
137+ $ reject_if_no_reverse_dns = false ;
138+
139+ // ※逆引きできないIPアドレスの利用者も多いため、true にすると一部の正当なユーザーが投稿できなくなる可能性があります。
140+
133141/*使用目的別設定*/
134142
135143// ホームページへ戻るリンクを上段のメニューに表示する
Original file line number Diff line number Diff line change @@ -1147,12 +1147,15 @@ function is_ngword ($ngwords, $strs): bool {
11471147
11481148/* 禁止ホストチェック */
11491149function is_badhost (): bool {
1150- global $ badhost ;
1150+ global $ badhost, $ reject_if_no_reverse_dns ;
11511151 //ホスト取得
11521152 $ userip = get_uip ();
11531153 $ host = $ userip ? gethostbyaddr ($ userip ) :'' ;
11541154
11551155 if ($ host === $ userip ){//ホスト名がipアドレスになる場合は
1156+ if ($ reject_if_no_reverse_dns ){
1157+ return true ; //リバースDNSがない場合は拒絶
1158+ }
11561159 foreach ($ badhost as $ value ){
11571160 if (preg_match ("/\A $ value/i " ,$ host )) {//前方一致
11581161 return true ;
Original file line number Diff line number Diff line change 11<?php
22//Petit Note (c)さとぴあ @satopian 2021-2025
33//1スレッド1ログファイル形式のスレッド式画像掲示板
4- $ petit_ver ='v1.88.9 ' ;
5- $ petit_lot ='lot.20250529 ' ;
4+ $ petit_ver ='v1.88.10 ' ;
5+ $ petit_lot ='lot.20250530 ' ;
66
77$ lang = ($ http_langs = $ _SERVER ['HTTP_ACCEPT_LANGUAGE ' ] ?? '' )
88 ? explode ( ', ' , $ http_langs )[0 ] : '' ;
1818 die (__DIR__ .'/functions.php ' .($ en ? ' does not exist. ' :'がありません。 ' ));
1919}
2020require_once (__DIR__ .'/functions.php ' );
21- if (!isset ($ functions_ver )||$ functions_ver <20250529 ){
21+ if (!isset ($ functions_ver )||$ functions_ver <20250530 ){
2222 die ($ en ?'Please update functions.php to the latest version. ' :'functions.phpを最新版に更新してください。 ' );
2323}
2424
116116$ darkmode_by_default = $ darkmode_by_default ?? false ;
117117$ sitename = $ sitename ?? '' ;
118118$ fetch_articles_to_skip = $ fetch_articles_to_skip ?? true ;
119+ $ reject_if_no_reverse_dns = $ reject_if_no_reverse_dns ?? false ;
119120$ mode = (string )filter_input_data ('POST ' ,'mode ' );
120121$ mode = $ mode ? $ mode :(string )filter_input_data ('GET ' ,'mode ' );
121122$ resno =(int )filter_input_data ('GET ' ,'resno ' ,FILTER_VALIDATE_INT );
122123$ userip = get_uip ();
123124$ httpsonly = (bool )($ _SERVER ['HTTPS ' ] ?? '' );
124-
125125//user-codeの発行
126126$ usercode = t (filter_input_data ('COOKIE ' , 'usercode ' ));//user-codeを取得
127127
You can’t perform that action at this time.
0 commit comments