[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 11:12:36 CEST 2008


Oliver Hader schrieb:<
> 
> I attached a new patch which two changes:
> * If the condition is e.g. "/^/$/" it will fail because of the unescaped
> PREG delimiter in the middle of the pattern - this is just an additional
> bugfix.

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))


Masi


More information about the TYPO3-team-core mailing list