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

Executes PHP code. Use with care.

File

modules/php/php.module, line 71
Additional filter for PHP input.

Code

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;
  }
}