1 頁 (共 1 頁)

[外掛]文字過濾修正

發表於 : 2006-04-12 , 11:09
懸壺子
[外掛]文字過濾修正
今天完成 s1:

修正文字過濾不適用中文系統之問題。

打開includes/functions.php,尋找
代碼:

代碼: 選擇全部

$orig_word[] = '#b(' . str_replace('*', 'w*?', phpbb_preg_quote($row['word'], '#')) . ')b#i';


取代
代碼:

代碼: 選擇全部

$orig_word[] = '#' . phpbb_preg_quote($row['word'], '#') . '#i'; 

備註:
1.可以用來取代注音文
2.無法使用萬用字元*
3.在UTF8系統上測試無誤,未修改的BIG5系統就不知道了..

另外,上面的文字過濾修正以及這篇中文(big5)語系 highlight 修正,有時候會失效(例如在>符號後面的關鍵字不會正確highlight),修正如下:

打開viewtopic.php,尋找:
代碼:
$message = str_replace('"', '"', substr(preg_replace('#(>(((?>([^><]+|(?R)))*)<))#se', "preg_replace('#(" . $highlight_match . ")#i', '<span style="color:#" . $theme['fontcolor3'] . ""><b>1</b></span>', '0')", '>' . $message . '<'), 1, -1));
取代
代碼:

代碼: 選擇全部

$message = str_replace('"', '"', preg_replace('#(' . $highlight_match . ')#i', '<span style="color:#' . $theme['fontcolor3'] . '"><b>1</b></span>', $message)); 
尋找
代碼:

代碼: 選擇全部

$user_sig = str_replace('"', '"', substr(preg_replace('#(>(((?>([^><]+|(?R)))*)<))#se', "preg_replace($orig_word, $replacement_word, '0')", '>' . $user_sig . '<'), 1, -1)); 
取代
代碼:

代碼: 選擇全部

$user_sig = str_replace('"', '"', preg_replace($orig_word, $replacement_word, $user_sig)); 
尋找
代碼:

代碼: 選擇全部

$message = str_replace('"', '"', substr(preg_replace('#(>(((?>([^><]+|(?R)))*)<))#se', "preg_replace($orig_word, $replacement_word, '0')", '>' . $message . '<'), 1, -1)); 
取代
代碼:

代碼: 選擇全部

$message = str_replace('"', '"', preg_replace($orig_word, $replacement_word, $message));