Index: modules/filter/filter.module =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v retrieving revision 1.300 diff -u -p -r1.300 filter.module --- modules/filter/filter.module 23 Oct 2009 22:24:14 -0000 1.300 +++ modules/filter/filter.module 30 Oct 2009 04:06:51 -0000 @@ -729,6 +729,18 @@ function _filter_tips($format_id, $long foreach ($formats as $format) { $filters = filter_list_format($format->format); $tips[$format->name] = array(); + // If the text format does not remove or escape any HTML, add a special + // filter tip which explains that HTML is allowed. We detect these cases by + // defining an invalid HTML tag and running it through the text format. + // Since any (reasonable) HTML filter uses a whitelist approach when + // filtering, we expect this tag to either be removed or escaped if the + // text format restricts HTML in any way. + $fake_tag = ''; + if (strpos(check_markup($fake_tag, $format->format, '', TRUE), $fake_tag) !== FALSE) { + $tips[$format->name][] = array('tip' => t('All HTML tags are allowed.'), 'id' => 'filter-all-html'); + } + // Now go through and add each of the regular filter tips associated with + // this text format. foreach ($filters as $name => $filter) { if (isset($filter_info[$name]['tips callback']) && function_exists($filter_info[$name]['tips callback'])) { $tip = $filter_info[$name]['tips callback']($filter, $format, $long);