--- g2.module 25 Aug 2007 13:14:03 -0000 1.19.2.2
+++ g2.module 28 Oct 2009 17:44:20 -0000
@@ -952,7 +952,7 @@
* The return value depends on $op. The filter hook is designed so that a
* module can return $text for operations it does not use/need.
*/
-function g2_filter($op, $delta = 0, $format = -1, $text = '') {
+function g2_filter($op, $delta = 0, $format = -1, $text = '', $cache_id = 0) {
switch ($op) {
case 'list':
return array(0 => t('G2 Glossary filter'));
@@ -961,13 +961,13 @@
return t('Allows users to link to G2 entries using <dfn> elements.');
case 'prepare':
- // 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('@(.+?)@s', "\xFEdfn\xFF\\1\xFE/dfn\xFF", $text);
+ // Note: we use the placeholder [g2-dfn] to replace < > during the filtering process.
+ // See http://drupal.org/node/209715 for documentation on filter placeholders
+ $text = preg_replace('@(.+?)@s', "[g2-dfn]\\1[/g2-dfn]", $text);
return $text;
- case "process":
- $text = preg_replace('@\xFEdfn\xFF(.+?)\xFE/dfn\xFF@se', "_g2_filter_process('$1')", $text);
+ case 'process':
+ $text = preg_replace("@\[g2-dfn\](.+?)\[/g2-dfn\]@se", "_g2_filter_process('$1')", $text);
return $text;
default: