function htmlpurifier_update_7002 in HTML Purifier 7
Same name and namespace in other branches
- 7.2 htmlpurifier.install \htmlpurifier_update_7002()
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 also
File
- ./
htmlpurifier.install, line 302 - Install, update and uninstall functions for the HTML Purifier module.
Code
function htmlpurifier_update_7002() {
$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);
}
}