From 7bece6dda8f9092028ce2ecd469edc29338f3828 Mon Sep 17 00:00:00 2001 From: Jeremy Laine Date: Wed, 10 May 2006 21:51:17 +0000 Subject: [PATCH] fix handling of filter plugins without arguments --- ChangeLog | 3 +++ Makefile | 2 +- include/Plugin/Filter.php | 11 +++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b795c1..88dff6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Diogenes 0.9.18.1 + * fixed - fix handling of filter plugins without arguments + Diogenes 0.9.18 * improved - resync Textile plugin with Textpattern 4.0.2 * improved - merge page catalog and file browser with slicker layout diff --git a/Makefile b/Makefile index e51b6ee..5f230f2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # definitions -VERSION = 0.9.18 +VERSION = 0.9.18.1 PKG_DIST = diogenes-$(VERSION) LIB_DIST = libdiogenes-$(VERSION) diff --git a/include/Plugin/Filter.php b/include/Plugin/Filter.php index 58dcd85..d9cdf50 100644 --- a/include/Plugin/Filter.php +++ b/include/Plugin/Filter.php @@ -47,14 +47,21 @@ class Diogenes_Plugin_Filter extends Diogenes_Plugin_Skel */ function filter($input) { + global $page; $name = $this->name; $mask = "/(\{$name(\s+[^\}]*)?\})/"; $bits = preg_split($mask, $input, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); $output = ""; while($bit = array_shift($bits)) { - if (preg_match($mask, $bit)) { - $argstr = array_shift($bits); + $matches = array(); + if (preg_match($mask, $bit, $matches)) { + if ($matches[2]) + { + $argstr = array_shift($bits); + } else { + $argstr = ""; + } $argbits = preg_split("/\s/", trim($argstr)); $args = array(); foreach($argbits as $argbit) -- 2.1.4