[TYPO3-project-formidable] Template Engine: Bug when using isLoggedIn().isFalse() twice

Hauke Hain newgrp at googlemail.com
Fri Mar 6 15:14:46 CET 2009


Hi,

I am not quite sure why my templates does not work with formidable without 
changing the pattern.

If I do not change it to $sPattern = '/\<\!\-\-.*(\#\#\#(.+)\ 
\bperimeter\b\#\#\#).*begin\-\-\>([^\\1.]*)\<\!\-\-.*\\1.*end\-\-\>/';
I do not get anything displayed.

However, can you repeat the Bug? I think the whole thing would work with 
replace instead of using regular expressions, as TYPO3 uses it.

If it is ok, you may change the $pattern to my version. It is a bit more 
specific and the groups are different. And it works for me only.
On the other hand: Can you imagine why this happens to me? Perhaps you see 
something I don't (within the other posts in this thread).

Thank you in advance.

Kind regards,
Hauke

"Hauke Hain" <newgrp at googlemail.com> schrieb im Newsbeitrag 
news:mailman.1.1235588293.18628.typo3-project-formidable at lists.netfielders.de...
> Regular Expressions are powerful, but not easy to understand.
>
> I do not understand how the function processPerimetersCallBack is called.
>
> It is calles via
> $sHtml = preg_replace_callback(
>   $sPattern,
>   array(
>    &$this,
>    "processPerimetersCallBack"
>   ),
>   $sHtml,
>   -1 // no limit
>  );
>
> But how does it get its parameter?
>
>
>
> The problem with processPerimeters is, that Match[3] contents the whole 
> content from the first <!-- ###isLoggedIn().isFalse() perimeter### 
> begin--> to the last <!-- ###isLoggedIn().isFalse() perimeter### 
> end-->....
>
>
> And sorry, I said a few hours ago, that this only happens with 
> isLoggedIn().isFalse()  - it seems to happen with every condition which is 
> used more than once.
>
>
>
> I changed in the regular expression that not every a-z and A-Z charackter 
> is ok, but every charackter that is not the first group-string:
> [^\\1.]
>
> Replace
>  $sPattern = '/\<\!\-\-.*(\#\#\#(.+)\ 
> \bperimeter\b\#\#\#).*begin\-\-\>([\w\W]*)\<\!\-\-.*\\1.*end\-\-\>/';
> with
> $sPattern = '/\<\!\-\-.*(\#\#\#(.+)\ 
> \bperimeter\b\#\#\#).*begin\-\-\>([^\\1.]*)\<\!\-\-.*\\1.*end\-\-\>/';
>
>
> Now everything is shown and nothing left, but *some* parts are shown, that 
> shouldn't.
>
> The first <!-- ###isLoggedIn().isFalse() perimeter### begin--> ... <!--  
> ###isLoggedIn().isFalse() perimeter### end--> Part is shown or hidden as 
> it should be.
>
> The second Part is always shown.
>
> At least nothing is left anymore.
>
> I hope you can fix the rest. That was enough for today.
>
> Sincerely,
> Hauke
> 



More information about the TYPO3-project-formidable mailing list