博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
discuz 启用html code 显示问题
阅读量:7235 次
发布时间:2019-06-29

本文共 810 字,大约阅读时间需要 2 分钟。

如果想一直使用的话,source/function/function_discuzcode.php里面的

$htmlon = $htmlon && $allowhtml ? 1 : 0; // 修改为 $htmlon = $htmlon && $allowhtml ? 1 : 1;
 
if(!$htmlon) {        $message = dhtmlspecialchars($message);    }

这样html的就可以使用了,但是所有人都能使用,这个后续再来研究,目前已经可以满足要求了。

 

当然也可以自己定义function_core.php里的

function dhtmlspecialchars($string) {    if(is_array($string)) {        foreach($string as $key => $val) {            $string[$key] = dhtmlspecialchars($val);        }    } else {        $string = str_replace(array('&', '"', '<', '>'), array('&', '"', '<', '>'), $string);        if(strpos($string, '&#') !== false) {            $string = preg_replace('/&((#(\d{3,5}|x[a-fA-F0-9]{4}));)/', '&\\1', $string);        }    }    return $string;}

这样可以自己控制哪些标签的替换。

 

 

转载于:https://www.cnblogs.com/awinlei/archive/2013/01/14/2860218.html

你可能感兴趣的文章
ntfs共享权限有哪些
查看>>
【转】${sessionScope.user}的使用方法
查看>>
Node.js之Express四
查看>>
Lind.DDD.Events事件总线~自动化注册
查看>>
oracle中如何设置主键并且让其自动增长
查看>>
如何才能知道外线是FSK还是DTMF制式?
查看>>
【NLP】揭秘马尔可夫模型神秘面纱系列文章(四)
查看>>
字符型图片验证码识别完整过程及Python实现
查看>>
RC4加密算法
查看>>
MySQL关于exists的一个bug
查看>>
单调队列
查看>>
关于hibernate链接数据源的配置参数详细解释(转)
查看>>
Android 【问题汇总】列表数组越界的问题
查看>>
c# ini file
查看>>
http://blog.csdn.net/z69183787/article/details/37819831
查看>>
IEEEXtreme Practice Community Xtreme9.0 - Digit Fun!
查看>>
阿里云对象存储OSS————跨域资源共享(CORS)(m3u8 无法加载m3u8:跨域访问被拒绝)...
查看>>
利用Git进行团队协作
查看>>
C++11 并发指南五(std::condition_variable 详解)(转)
查看>>
slf4j 与各个 logging框架的适配器说明
查看>>