thinkSNS 中发说说 引号转义问题

WBOY
Release: 2016-06-23 13:51:41
Original
948 people have browsed it

ts框架在发表说说时,对于输入的引号和反斜杠的会出现显示上的错误,如:输入   "好耶"  ,  发布后显示    \"好耶\" ,后天取到的是没有斜杠的,显示的时候就有了,单引号也是如此。
不知道是thinksns低版本存在的问题还是什么情况,在thinksns3.1中没有这种情况,代码我也对比过研究过,没发现实质性的区别,想请问是否是模板渲染的时候的问题,如果是这改如何修改呢?
求大神赐教。


回复讨论(解决方案)

输出时转义了?
这是 bug,改了就是了

后台从数据库里获取后是正常的,输出到页面渲染就不行了,应该是模板渲染的方法问题吧,我之前从没动过TS框架这方面的东西,所以就不知道怎么改,尝试过替换、反转义都多多少少会有问题,所以就有点纠结了!

问题已解决,使用stripslashes()和addslashes()解决的,在把说说写进数据库时,用addslashes()方法转义,从数据库读出是,再用stripslashes()反转就行了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!