【问题标题】:pear BBCodeParser2 couldn't parse WysiBB linkspear BBCodeParser2 无法解析 WysiBB 链接
【发布时间】:2015-04-25 13:46:29
【问题描述】:

我使用 pear BBCodeParser2Wysibb 编辑器,它适用于大多数 bbcode,如粗体、斜体、图像......等

问题仅在链接中,它无法解析主题中的url,当我查看db表时,我发现url bbcode没有改变...... 我检查了所有包含的链接和文件,问题还是一样:

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();

来自数据库的图像:

【问题讨论】:

    标签: php pear bbcode


    【解决方案1】:

    我找到了解决办法

    问题是我应该在 parse() 函数之后转义字符 所以前面的代码是:

     $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());
    

    【讨论】:

      猜你喜欢
      • 2019-09-18
      • 2013-11-12
      • 2011-12-19
      • 2012-03-08
      • 2013-09-28
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多