【问题标题】:HTMLPurifier config errorHTMLPurifier 配置错误
【发布时间】:2010-06-03 19:15:57
【问题描述】:

我正在尝试为 HTMLPurifier 设置一些配置,并且在我的开发机器上一切正常,但在测试时,它失败了。

找不到错误类“HTMLPurifier_config”。 但如果我删除配置,它运行没有问题。 我正在使用 HTMLPurifier 4.0.0

$config=HTMLPurifier_config::createDefault();
$config->set('AutoFormat','AutoParagraph', true);
$config->set('AutoFormat','Linkify', true);

$purifier = new HTMLPurifier($config);

我正在使用 HTMLPurifier.auto.php 加载 HTMLPurifier,但正如我所说,这在开发中工作,但不是测试。

【问题讨论】:

    标签: php htmlpurifier


    【解决方案1】:

    config 需要大写。

    【讨论】:

    • 显然我一直在处理旧文档。除了 config 是 'Config' 之外,该集合现在是 'set('AutoFormat.AutoParagraph', true)。
    • config 从未小写,但配置格式最近发生了变化(旧样式仍然有效,它只是发出警告。)
    猜你喜欢
    • 1970-01-01
    • 2015-05-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-28
    • 2012-01-12
    相关资源
    最近更新 更多