Download & Extend

Deprecated API notices when using trunk version

Project:HTML Purifier
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

HTMLPurifier has some upcoming API changes (they are currently in the trunk version) that throw several "Deprecated API notices" with the current version of HTMLPurifier. They are descriptive notices though, so I was able to make all the changes it suggested very easily.

Specifically I changed lines 186-199 of htmlpurifier.module, which originally said

  $config->set('AutoFormat', 'AutoParagraph', TRUE);
  $config->set('AutoFormat', 'Linkify', TRUE);
  $config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional'); // Probably
  $config->set('Core', 'AggressivelyFixLt', TRUE);
  $config->set('Cache', 'DefinitionImpl', 'Drupal');

  // Filter HTML doesn't allow external images, so neither will we...
  // for now. This can be configured off.
  $config->set('URI', 'DisableExternalResources', TRUE);

  if (!empty($_SERVER['SERVER_NAME'])) {
    // SERVER_NAME is more reliable than HTTP_HOST
    $config->set('URI', 'Host', $_SERVER['SERVER_NAME']);
  }

to this:

$config->set('AutoFormat.AutoParagraph', TRUE);
  $config->set('AutoFormat.Linkify', TRUE);
  $config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); // Probably
  $config->set('Core.AggressivelyFixLt', TRUE);
  $config->set('Cache.DefinitionImpl', 'Drupal');

  // Filter HTML doesn't allow external images, so neither will we...
  // for now. This can be configured off.
  $config->set('URI.DisableExternalResources', TRUE);

  if (!empty($_SERVER['SERVER_NAME'])) {
    // SERVER_NAME is more reliable than HTTP_HOST
    $config->set('URI.Host', $_SERVER['SERVER_NAME']);
  }

This bug came up, and this report was requested in this discussion: http://drupal.org/node/476552

Comments

#1

Hi,

I also got a lot of "Deprecated API notices" warnings after upgrading to HTMLPurifier 4.0 by using the default setting in Drupal.

#2

Priority:normal» critical

Now that HTML Purifier 4.0 is out, getting this module updated is pretty high priority. For now, you can manually patch out the errors.

#3

Status:active» fixed

Fixed in 6.x-2.0 release. Have fun!

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here