Index: htmlpurifier.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/htmlpurifier/htmlpurifier.module,v
retrieving revision 1.2.2.4
diff -u -p -r1.2.2.4 htmlpurifier.module
--- htmlpurifier.module	12 May 2008 19:25:05 -0000	1.2.2.4
+++ htmlpurifier.module	8 Oct 2008 23:56:54 -0000
@@ -169,6 +169,11 @@ function _htmlpurifier_settings($format)
 }
 
 function _htmlpurifier_get_config($format) {
+  // Create directory for cache storage if necessary
+  file_check_directory(file_create_path('htmlpurifier'), FILE_CREATE_DIRECTORY);
+  $serializer_cache_directory = file_create_path('htmlpurifier/serializer');
+  file_check_directory($serializer_cache_directory, FILE_CREATE_DIRECTORY);
+
   $config = array(
     'Core.AggressivelyFixLt' => TRUE,
     'URI.DisableExternalResources' => variable_get("htmlpurifier_externalresources_$format", TRUE),
@@ -178,6 +183,7 @@ function _htmlpurifier_get_config($forma
     'HTML.Allowed' =>
         variable_get("htmlpurifier_allowedhtml_enabled_$format", FALSE) ?
         variable_get("htmlpurifier_allowedhtml_$format", '') : null,
+    'Cache.SerializerPath' => $serializer_cache_directory,
   );
   if (defined('HTMLPurifier::VERSION') && version_compare(HTMLPurifier::VERSION, '3.1.0-dev', '>=')) {
     $config['HTML.ForbiddenElements']   = variable_get("htmlpurifier_forbiddenelements_$format", '');
