[外掛]讓後台文字過濾系統能夠處理廣告連結

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
Martinet
竹貓忠實會員
竹貓忠實會員
文章: 850
註冊時間: 2003-06-09 21:58
聯繫:

[外掛]讓後台文字過濾系統能夠處理廣告連結

文章 Martinet »

代碼: 選擇全部

####################################################################
## Mod Title:   Replace naughty words before parcing bbcode
## Mod Version: 0.0.1
## Author:      Martinet
##
## Description: 
## This mod makes the naughty words replacement function on the url as well
## 原本phpBB文字過濾無法作用在連結上,而這個Mod提供一個簡單的修改使得文字過濾能夠幫忙處理廣告連結
## 
##
## This mod is only tested on phpBB 2.0.22
##
##
## Installation Level:  Very Easy
## Installation Time:   1 Minute
## Files To Edit:      1
##   viewtopic.php
##
##################################################################
#Notes:
#  本Mod初步測試過,暫時沒發現什麼Bug,如果發現問題,還請各位回報一下,謝謝。
#
##################################################################

開啟 viewtopic.php
找到下面這段

代碼: 選擇全部

	//
	// Replace naughty words
	//
	if (count($orig_word))
	{
		$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);

		if ($user_sig != '')
		{
			$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
	}
將整段刪除

接著找下面這段

代碼: 選擇全部

	//
	// Parse message and/or sig for BBCode if reqd
	//
在前面貼上

代碼: 選擇全部

	//
	// Replace naughty words
	//
	if (count($orig_word))
	{
		$post_subject = preg_replace($orig_word, $replacement_word, $post_subject);

		if ($user_sig != '')
		{
			$user_sig = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1));
		}

		$message = str_replace('\"', '"', substr(@preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "@preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1));
	}
儲存關閉viewtopic.php
主題已鎖定

回到「非官方認證外掛」