php_filter

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

Implementation of hook_filter(). Contains a basic PHP evaluator.

Executes PHP code. Use with care.

Code

modules/php/php.module, line 72

<?php
function php_filter($op, $delta = 0, $format = -1, $text = '') {
  switch ($op) {
    case 'list':
      return array(0 => t('PHP evaluator'));
    case 'no cache':
      // No caching for the PHP evaluator.
      return $delta == 0;
    case 'description':
      return t('Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!');
    case 'process':
      return drupal_eval($text);
    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