summaryrefslogtreecommitdiff
path: root/modules/php
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-08-13 19:53:20 +0000
committerDries Buytaert <dries@buytaert.net>2009-08-13 19:53:20 +0000
commit2abbabbcc2f8662eb50abf0bb0e56e93bfff62e9 (patch)
tree567b34befd844f68585b8b85a1982afb9fa1c0ea /modules/php
parentecfa5477e72cac640dea51f0a54eece486c9bf9d (diff)
downloadbrdo-2abbabbcc2f8662eb50abf0bb0e56e93bfff62e9.tar.gz
brdo-2abbabbcc2f8662eb50abf0bb0e56e93bfff62e9.tar.bz2
- Patch #546336 by dropcube: transform hook_filter from having a paramater to hook_filter_().
Diffstat (limited to 'modules/php')
-rw-r--r--modules/php/php.module27
1 files changed, 12 insertions, 15 deletions
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'
+ )
+ );
}