> ∧ ∧
> /(´ー`)ノ<穴ふさぎ
>  ̄ ̄ ̄ ̄ ̄|
> bbs.phpに以下の変更を加える事により特殊文字をエスケープ出来ます
> 該当部分(tree.phpはよくわからないのでスルー)
> /**
> * メッセージ表示内容定義
> */
> function setmessage($message, $mode = 0, $tlog = '') {
> if (count($message) < 10) {
> return;
> }
> $message['WDATE'] = Func::getdatestr($message['NDATE'],this->c['DATEFORMAT']);
> #20181102 擬古猫 特殊文字をエスケープする
> $message['MSG'] = preg_replace("/{/i","{", $message['MSG'], -1);
> $message['MSG'] = preg_replace("/}/i","}", $message['MSG'], -1);
> # 「参考」
> if (!$mode) {
> $message['MSG'] = preg_replace("/<a
> href=\"m=f&s=(\d+)[^>]+>([^<]+)<\/a>$/i",
> "<a href=\"{$this->c['CGIURL']}?m=f&s=$1&{$this->s['QUERY']}\">$2</a>",message['MSG'], 1);
<bbstree.phpの穴ふさぎ他
/**
* テキストツリー出力
*
* @param Array &$msgcurrent 親メッセージ
* @param Array &$thread 親子を含むメッセージの配列
*/
function prttexttree(&$msgcurrent, &$thread) {
print "<span class= \"ngline\"><pre class=\"msgtree\"><a href=\"{$this->s['DEFURL']}&m=t&s={$msgcurrent['THREAD']}\" target=\"link\">{$this->c['TXTTHREAD']}</a>";
$msgcurrent['WDATE'] = Func::getdatestr($msgcurrent['NDATE']);
print "<span class=\"update\"> [更新日:{$msgcurrent['WDATE']}]</span>\r";
$tree =& $this->gentree(array_reverse($thread), $msgcurrent['THREAD']);
$tree = str_replace("</span><span class=\"bc\">", "", $tree);
$tree = str_replace("</span> <span class=\"bc\">", " ", $tree);
$tree = ' ' . str_replace("\r", "\r ", $tree);
#20181110 擬古猫 特殊文字をエスケープする
$tree = str_replace("{","{", $tree);
$tree = str_replace("}","}", $tree);
#20181110 擬古猫 Unicode変換用
$tree = preg_replace("/&#(\d+);/","&#$1;", $tree );
print $tree . "</pre>\n\n<hr></span>\n\n";
}
参考:2018/11/02(金) 23:44:05