Index: codefilter.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/codefilter/codefilter.module,v retrieving revision 1.24 diff -u -p -r1.24 codefilter.module --- codefilter.module 28 Dec 2006 22:49:16 -0000 1.24 +++ codefilter.module 30 Oct 2007 17:37:30 -0000 @@ -99,14 +99,34 @@ function codefilter_filter($op, $delta = // Note: we use the bytes 0xFE and 0xFF to replace < > during the filtering process. // These bytes are not valid in UTF-8 data and thus least likely to cause problems. $text = preg_replace('@(.+?)@se', "'\xFEcode\xFF'. codefilter_escape('\\1') .'\xFE/code\xFF'", $text); - $text = preg_replace('@[\[<](\?php|%)(.+?)(\?|%)[\]>]@se', "'\xFEphp\xFF'. codefilter_escape('\\2') .'\xFE/php\xFF'", $text); + if (variable_get('codefilter_treat_asp_as_php', 1) == 1) { + $text = preg_replace('@[\[<](\?php|%)(.+?)(\?|%)[\]>]@se', "'\xFEphp\xFF'. codefilter_escape('\\2') .'\xFE/php\xFF'", $text); + } + else { + $text = preg_replace('@[\[<](\?php)(.+?)(\?)[\]>]@se', "'\xFEphp\xFF'. codefilter_escape('\\2') .'\xFE/php\xFF'", $text); + } return $text; - case "process": + case 'process': $text = preg_replace('@\xFEcode\xFF(.+?)\xFE/code\xFF@se', "codefilter_process_code('$1')", $text); $text = preg_replace('@\xFEphp\xFF(.+?)\xFE/php\xFF@se', "codefilter_process_php('$1')", $text); return $text; + case 'settings': + $form = array(); + $form['codefilter'] = array( + '#type' => 'fieldset', + '#title' => t('Codefilter'), + '#collapsible' => FALSE, + ); + $form['codefilter']['codefilter_treat_asp_as_php'] = array( + '#type' => 'checkbox', + '#default_value' => variable_get('codefilter_treat_asp_as_php', 1), + '#title' => t('Format ASP tags as PHP'), + '#description' => t('If enabled codefilter will treat ASP-style <% %> tags like PHP. Enable this if you want ASP to be formatted the same as PHP.'), + ); + return $form; + default: return $text; }