/source/function/function_core.php
- function censor($message, $modword = NULL, $return = FALSE) {
- global $_G;
- require_once libfile('class/censor');
- $censor = discuz_censor::instance();
- $censor->check($message, $modword);
- if($censor->modbanned() && !$_G['group']['ignorecensor']) {
- $wordbanned = implode(', ', $censor->words_found);
- if($return) {
- return array('message' => lang('message', 'word_banned', array('wordbanned' => $wordbanned)));
- }
- if(!defined('IN_ADMINCP')) {
- showmessage('word_banned', '', array('wordbanned' => $wordbanned));
- } else {
- cpmsg(lang('message', 'word_banned'), '', 'error', array('wordbanned' => $wordbanned));
- }
- }
- if($_G['group']['allowposturl'] == 0 || $_G['group']['allowposturl'] == 2) {
- $urllist = get_url_list($message);
- if(is_array($urllist[1])) foreach($urllist[1] as $key => $val) {
- if(!$val = trim($val)) continue;
- if(!iswhitelist($val)) {
- if($_G['group']['allowposturl'] == 0) {
- showmessage('post_url_nopermission');//抱歉,您没有权限发表 URL 连接
- } elseif($_G['group']['allowposturl'] == 2) {
- $message = str_replace('[url]'.$urllist[0][$key].'[/url]', $urllist[0][$key], $message);
- $message = preg_replace(
- array(
- "@\[url=.*?".preg_quote($urllist[0][$key],'@').".*?\](.*?)\[/url\]@is",
- "@href=('|")".preg_quote($urllist[0][$key],'@')."\\1@is",
- "@\[url\](.*?".preg_quote($urllist[0][$key],'@').".*?)\[/url\]@is",
- ),
- array(
- '\\1',
- '',
- '\\1',
- ),
- $message);
- }
- }
- }
- }
- return $message;
- }
复制代码
\source\language/lang_message.php
- 'post_url_nopermission' => '抱歉,您没有权限发表 URL 连接',
复制代码
后台设置
|