cvs: pear /HTML_Template_Xipe/Xipe/Filter TagLib.php

From: Date: Tue, 01 Apr 2003 17:46:58 +0000
Subject: cvs: pear /HTML_Template_Xipe/Xipe/Filter TagLib.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-9698@lists.php.net to get a copy of this message
cain Tue Apr 1 12:46:58 2003 EDT Modified files: /pear/HTML_Template_Xipe/Xipe/Filter TagLib.php Log: - do endmacro first, it makes some weird exception in the reg-exp below work :-) Index: pear/HTML_Template_Xipe/Xipe/Filter/TagLib.php diff -u pear/HTML_Template_Xipe/Xipe/Filter/TagLib.php:1.21 pear/HTML_Template_Xipe/Xipe/Filter/TagLib.php:1.22 --- pear/HTML_Template_Xipe/Xipe/Filter/TagLib.php:1.21 Tue Apr 1 08:05:27 2003 +++ pear/HTML_Template_Xipe/Xipe/Filter/TagLib.php Tue Apr 1 12:46:58 2003 @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Authors: Wolfram Kriesing <wolfram@kriesing.de> | // +----------------------------------------------------------------------+ -// $Id: TagLib.php,v 1.21 2003/04/01 13:05:27 cain Exp $ +// $Id: TagLib.php,v 1.22 2003/04/01 17:46:58 cain Exp $ // require_once 'HTML/Template/Xipe/Options.php'; @@ -151,6 +151,10 @@ $_closeDel = $this->getOption('delimiter',1); $autoBraces = $this->getOption('autoBraces'); + // if someone has autoBraces on and uses this.... well that would be a user-mistake, or a missing doc :-) + $regExp = '/[^\\\]'.$openDel.'%\s*endrepeat\s*%'.$closeDel.'/Ui'; + $input = preg_replace( $regExp , $_openDel.($autoBraces?' \\} ':' endfor ').$_closeDel , $input ); + // find those repeats which dont have no variable that is given as the loop variable // we need to do this, since the next regExp needs this variable name, because // we can not use the $5 to check if it is given (down there in the second regExp)... bummer @@ -182,11 +186,7 @@ //"REPEAT:<br>1='$1'<br>2='$2'<br>3='$3'<br>4='$4'<br>5='$5'<br>6='$6'<br>" , // for testing $input); // replace unnecessary spaces, so the next regexp is shorter and easier - - // if someone has autoBraces on and uses this.... well that would be a user-mistake, or a missing doc :-) - $regExp = '/[^\\\]'.$openDel.'%\s*endrepeat\s*%'.$closeDel.'/Ui'; - $input = preg_replace( $regExp , $_openDel.($autoBraces?' \\} ':' endfor ').$_closeDel , $input ); - + return $input; /* TESTS

« previous php.pear.cvs (#9698) next »