X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2FPlugin%2FFilter.php;h=d9cdf5033c3f27732245ac2ada20ae27c06c0816;hb=83a56cb5c8a85bc4eb577547ed3ddf3f46fb25b0;hp=58dcd85fbd35666cda53c138fd9735bb50b2e2dd;hpb=6855525e48fad5de270500a5445c4f4ff85d8bda;p=diogenes.git 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)