<?php
/**
* @author moufer<moufer@163.com>
* @copyright www.modoer.com
* @version $Id 2 2008-09-17 12:46 $
*/
!defined('IN_MUDDER') && exit('Access Denied');

// 词语过滤
function filterWords($content) {
    global $_filters;
	require_once(MUDDER_ROOT.'./data/cachefiles/cache_filters.php');

	if($_filters['block'] && preg_match($_filters['block'], preg_replace("/\s*|\[[^\]]*\]/i", '', $content))) {
		redirect('对不起，您提交的内容包含不良词语，请返回修改。');
	} else {
		return empty($_filters['filter']) ? $content :
			@preg_replace($_filters['filter']['search'], $_filters['filter']['replace'], $content);
	}
}

// 词语过滤_审核判断
function filterCheck($content) {
    global $_filters;
    require_once(MUDDER_ROOT.'./data/cachefiles/cache_filters.php');

    return $_filters['check'] && preg_match($_filters['check'], $content);
}
?>