[TYPO3-core] RFC #8566: Unable to match TS condition when variable is not set

Martin Kutschker masi-no at spam-typo3.org
Mon Jul 14 15:59:26 CEST 2008


Dmitry Dulepov [typo3] schrieb:
> Hi!
> 
> Martin Kutschker wrote:
>> But they user could have used \/ which is valid, but your "fix" denies
>> him this possibility. I wouldn't add an extra test, but use @ in the
>> test and maybe add a not to the TS error stack for the admin panel.
>>
>> Simpel change for readability:
>>
>> if (preg_match('|^/.+/$|', $needle))
>>
>> Preferred change that allows / and | to be used as regexp "brackets":
>>
>> if (preg_match('#^/.+/$|^.+|$#', $needle))
> 
> I am ok to this. I like this more than Olly's patch.

I you choose the latter please add a note to pending docs about the new
|regepx| feature.

Either way, if you're really cool, you could a) use @ for the regexp in
case the user breaks the regexp and b) check if he made a mistake and
add a little admin panel note ;-)

Masi


More information about the TYPO3-team-core mailing list