From 0d71a96e345957ce96c3d02b7b63204e45813e78 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sat, 11 Jul 2009 10:19:30 +1000 Subject: [PATCH] Display error if there is only 1 autoFill param --- lib/Template.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/Template.php b/lib/Template.php index 6b5c44c..933be10 100644 --- a/lib/Template.php +++ b/lib/Template.php @@ -994,6 +994,15 @@ class Template extends xmlTemplate { U: Make the result upper case. */ case 'autoFill': + if (! preg_match('/;/',$arg)) { + system_message(array( + 'title'=>_('Problem with autoFill() in template'), + 'body'=>sprintf('%s (%s)',_('There is only 1 argument, when there should be two'),$attribute->getName(false)), + 'type'=>'warn')); + + return; + } + list($attr,$string) = preg_split('(([^,]+);(.*))',$arg,-1,PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); preg_match_all('/%(\w+)(\|[0-9]*-[0-9]*)?(\/[KklTUA]+)?%/U',$string,$matchall); //print"
";print_r($matchall); //0 = highlevel match, 1 = attr, 2 = subst, 3 = mod