dongqiang8058 2012-03-11 10:59 采纳率: 100%
浏览 33
已采纳

HTMLPurifier在引号前插入\

In the system I'm building I use CKEditor for writing posts. Then, when I send it to PHP I validate the html created from CKEditor with HTMLPurifier. The problem is that the HTMLPurifier adds \ before ". For example, the CKEditor produces:

<span style="font-size:36px;">

And after HTMLPurifier:

<span style=\"font-size:36px;\">

I'm using PHP 5.2. Why does HTMLPurifier adds these backslashes and what must I do to fix it?

  • 写回答

2条回答 默认 最新

  • douzhuan0309 2012-03-11 11:02
    关注

    It's not HTML purifier that adds the extra slashes, but your PHP configuration. Edit php.ini and disable magic_quotes_gpc.

    The linked manual suggests you to add the next setting to php.ini:

    magic_quotes_gpc = Off
    

    If you are using Apache and can use .htaccess files, create one with:

    php_flag magic_quotes_gpc Off
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 R运行没有名称为"species"的插槽对于此对象类"SDMmodelCV"
  • ¥20 基于决策树的数字信号处理,2ask 2psk 2fsk的代码,检查下报错的原因
  • ¥20 python作业求过程
  • ¥15 wincc已组态的变量过多
  • ¥60 如图:直线与椭圆X轴平行,求直线与椭圆任意一点的相切坐标计算公式
  • ¥50 如何用python使用opencv里的cv::cudacodec::VideoWriter函数对视频进行GPU硬编码
  • ¥100 c#solidworks 二次开发 工程图自动标边线法兰 等折弯尺寸怎么标
  • ¥15 halcon DrawRegion 提示错误
  • ¥15 FastAPI Uvicorn启动显示404
  • ¥15 centos7.9脚本,怎么排除特定的访问记录