diff --git htmlpurifier.install htmlpurifier.install index 841d09a..19e25c0 100644 --- htmlpurifier.install +++ htmlpurifier.install @@ -223,6 +223,27 @@ function htmlpurifier_update_6200() { function htmlpurifier_update_6201() {} /** + * Load and resave all text formats to update cache settings. + * + * This update will only work for 7-7 updates and will need to be run again + * once there is a 6-7 upgrade path. + * + * @see http://drupal.org/node/993230 + */ +function htmlpurifier_update_7000() { + $formats = filter_formats(); + foreach ($formats as $format) { + $format->filters = filter_list_format($format->format); + // filter_format_save() expects filters to be an array, however + // filter_list_format() gives us objects. + foreach ($format->filters as $key => $value) { + $format->filters[$key] = (array) $value; + } + filter_format_save($format); + } +} + +/** * TODO: Perform the D6->D7 upgrade. * * We need to update filter names and settings, in the same way that