Deprecated API notices when using trunk version

mattgilbert - July 3, 2009 - 15:51
Project:HTML Purifier
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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

#1

ball.in.th - July 9, 2009 - 17:28

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

ezyang - July 9, 2009 - 17:32
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

ezyang - July 10, 2009 - 00:05
Status:active» fixed

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

#4

System Message - July 24, 2009 - 00:10
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.