You are here

function _geshifilter_htmlfilter_conflicts in GeSHi Filter for syntax highlighting 6

Same name and namespace in other branches
  1. 5.2 geshifilter.conflicts.inc \_geshifilter_htmlfilter_conflicts()
  2. 7 geshifilter.conflicts.inc \_geshifilter_htmlfilter_conflicts()

conflict detection for html filter

1 string reference to '_geshifilter_htmlfilter_conflicts'
geshifilter_admin_filter_conflicts in ./geshifilter.conflicts.inc
Menu callback for filter conflicts page

File

./geshifilter.conflicts.inc, line 70

Code

function _geshifilter_htmlfilter_conflicts($format, $cfilter, $geshifilter) {
  $conflicts = array();

  // check order
  if ($cfilter->weight >= $geshifilter->weight) {
    $conflicts[] = array(
      'description' => t('%cfilter should not come after %geshifilter to prevent loss of layout and highlighting.', array(
        '%cfilter' => $cfilter->name,
        '%geshifilter' => $geshifilter->name,
      )),
      'solution' => l(t('Rearrange filters'), "admin/settings/filters/{$format}/order"),
    );
  }

  // check tag escaping of html filter
  if (variable_get("filter_html_{$format}", FILTER_HTML_STRIP) == FILTER_HTML_ESCAPE) {
    $conflicts[] = array(
      'description' => t('%cfilter is configured to "Escape all tags", which is likely to cause problems with %geshifilter.', array(
        '%cfilter' => $cfilter->name,
        '%geshifilter' => $geshifilter->name,
      )),
      'solution' => l(t('Configure HTML filtering to "Strip disallowed tags"'), "admin/settings/filters/{$format}/configure", array(
        'html' => TRUE,
      )),
    );
  }
  return $conflicts;
}