doujiao9866 2015-04-25 13:46
浏览 43
已采纳

pear BBCodeParser2无法解析WysiBB链接

i used pear BBCodeParser2 with Wysibb editor,it works good for most bbcodes like bold,italic,images....etc

the problem only in links,it can't parse urls in the topic,and when i look at db table, i found the url bbcode unchanged.... i checked all links and files included,and the problem still the same:

php:

       $config = parse_ini_file('HTML/BBCodeParser2.ini',true);
        $options = $config['HTML_BBCodeParser2'];
        $parser = new HTML_BBCodeParser2($options);
        $parser->setText($this->db->real_escape_string($_POST['t_body'])); 
        $parser->parse(); 
        $t_body= $parser->getParsed();

img from db: enter image description here

  • 写回答

1条回答 默认 最新

  • douzhankui0758 2015-04-25 14:56
    关注

    i found the solution

    the problem is that i should escape characters after parse() function so the previous code will be:

     $config = parse_ini_file('HTML/BBCodeParser2.ini',true);
            $options = $config['HTML_BBCodeParser2'];
            $parser = new HTML_BBCodeParser2($options);
            $parser->setText($_POST['t_body']); 
            $parser->parse(); 
            $t_body= $this->db->real_escape_string($parser->getParsed());
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码