From 2abbabbcc2f8662eb50abf0bb0e56e93bfff62e9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 13 Aug 2009 19:53:20 +0000 Subject: - Patch #546336 by dropcube: transform hook_filter from having a paramater to hook_filter_(). --- modules/php/php.module | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'modules/php') diff --git a/modules/php/php.module b/modules/php/php.module index fccb0464a..35996446e 100644 --- a/modules/php/php.module +++ b/modules/php/php.module @@ -121,24 +121,21 @@ else { } /** - * Implement hook_filter(). Contains a basic PHP evaluator. + * Implement hook_filter_info(). + * + * Contains a basic PHP evaluator. * * Executes PHP code. Use with care. */ -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 php_eval($text); - default: - return $text; - } +function php_filter_info() { + return array( + array( + 'name' => t('PHP evaluator'), + 'description' => t('Executes a piece of PHP code. The usage of this filter should be restricted to administrators only!'), + 'cache' => FALSE, + 'process callback' => 'php_eval' + ) + ); } -- cgit v1.2.3