Fatal error: Call to undefined method domdocument::loadHTML()
| Project: | HTML Purifier |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
( ! ) Fatal error: Call to undefined method domdocument::loadHTML() in D:\Webs\Drupal 6\sites\all\modules\htmlpurifier\library\HTMLPurifier\Lexer\DOMLex.php on line 59
Call Stack
# Time Memory Function Location
1 0.0015 69120 {main}( ) ..(null):0
2 2.9738 16040720 menu_execute_active_handler( ) ..(null):18
3 3.0393 16194216 call_user_func_array ( ) ..(null):346
4 3.0393 16194240 filter_admin_configure_page( ) ..(null):0
5 3.0397 16195256 drupal_get_form( ) ..(null):290
6 3.0397 16196704 call_user_func_array ( ) ..(null):102
7 3.0397 16196736 drupal_retrieve_form( ) ..(null):0
8 3.0398 16198048 call_user_func_array ( ) ..(null):359
9 3.0398 16198176 filter_admin_configure( ) ..(null):0
10 3.0662 16201648 module_invoke( ) ..(null):302
11 3.0663 16201968 call_user_func_array ( ) ..(null):450
12 3.0663 16202064 htmlpurifier_filter( ) ..(null):0
13 3.0663 16202552 _htmlpurifier_settings( ) ..(null):101
14 3.0663 16204384 _htmlpurifier_process( ) ..(null):251
15 3.0940 16802056 HTMLPurifier->purify( ) ..(null):147
16 3.1865 18065408 HTMLPurifier_Lexer_DOMLex->tokenizeHTML( ) ..(null):178

#1
Hi nutkenz,
As a stop-gap measure, you can instruct HTML Purifier to use the DirectLex lexer by setting %Core.LexerImpl to 'DirectLex' (you might have to use the raw PHP format in order to specify this).
I'm going to need more information about your PHP installation to debug this. What is your:
* PHP version
* DOM version
* libxml version
You can find this info in phpinfo(); Upload this snippet to your webserver and view it:
<?php phpinfo();
Your webhost may also publish this information.
#2
PHP Version 5.2.4
DOM/XML API Version 20031129
libxml Version 2.6.26
#3
What most likely happened is that your host has HTML support disabled. I can update the sniffer to check for this; do you think you can get your host to enable DOM HTML support?
#4
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.6.26
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
#5
If I'm not mistaken, the phpinfo indicates that DOM HTML is enabled? What else could the problem be?
#6
Yes, it does, which is all the more puzzling. Have you tried the stopgap measure? Also, who is your webhost? Could you publish a full copy of your phpinfo?
I'm really up a wall, because the DOM API version number is identical to mine.
#7
What is the stopgap measure?
http://nutkenz.net/phpinfo.php
#8
Using the DirectLex lexer. Here's how to do it: find modules/htmlpurifier/config and compy sample.php to N.php, where N is the filter ID HTML Puriifer is being used for. The default values should work well.
Oh, and don't forget to rename the function from *_N to *_(integer here)
#9
I believe this bug has been fixed upstream, as we specifically check for the dom extension and not the domxml extension.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.