filter_filter

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 – drupal7 filter_filter($op, $delta = 0, $format = -1, $text = '')

Implementation of hook_filter(). Contains a basic set of essential filters.

  • HTML filter: Validates user-supplied HTML, transforming it as necessary.
  • Line break converter: Converts newlines into paragraph and break tags.
  • URL and e-mail address filter: Converts newlines into paragraph and break tags.

Code

modules/filter/filter.module, line 621

<?php
function filter_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(0 => t('HTML filter'), 1 => t('Line break converter'), 2 => t('URL filter'), 3 => t('HTML corrector'));

    case 'description':
      switch ($delta) {
        case 0:
          return t('Allows you to restrict whether users can post HTML and which tags to filter out. It will also remove harmful content such as JavaScript events, JavaScript URLs and CSS styles from those tags that are not removed.');
        case 1:
          return t('Converts line breaks into HTML (i.e. &lt;br&gt; and &lt;p&gt; tags).');
        case 2:
          return t('Turns web and e-mail addresses into clickable links.');
        case 3:
          return t('Corrects faulty and chopped off HTML in postings.');
        default:
          return;
      }

    case 'process':
      switch ($delta) {
        case 0:
          return _filter_html($text, $format);
        case 1:
          return _filter_autop($text);
        case 2:
          return _filter_url($text, $format);
        case 3:
          return _filter_htmlcorrector($text);
        default:
          return $text;
      }

    case 'settings':
      switch ($delta) {
        case 0:
          return _filter_html_settings($format);
        case 2:
          return _filter_url_settings($format);
        default:
          return;
      }

    default:
      return $text;
  }
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen