diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-04-08 08:16:44 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-04-08 08:16:44 +0000 |
commit | e9d6817270fbd86e89c3743d2000d5906bdc222d (patch) | |
tree | ab87eca601fbd0732eab5106203c857902e8d8c0 /pmwiki.php | |
parent | 1da5b352ac11dfa301c93d7858de1bd71ca39eb1 (diff) | |
download | pmwiki.svn-e9d6817270fbd86e89c3743d2000d5906bdc222d.tar.bz2 |
Fix some cases with conditional markup and markup expressions where an empty code could be evaluated (suggested by Goodguy00).
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4685 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'pmwiki.php')
-rw-r--r-- | pmwiki.php | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -295,9 +295,10 @@ function CondExpr($pagename, $condname, $condparm) { } ## PITS:01480, (:if [ {$EmptyPV} and ... ]:) - $code = preg_replace('/(^\\s*|(and|x?or|&&|\\|\\||!)\\s+)(?=and|x?or|&&|\\|\\|)/', - '$1 0 ', trim(implode(' ', $terms))); + $code = trim(preg_replace('/(^\\s*|(and|x?or|&&|\\|\\||!)\\s+)(?=and|x?or|&&|\\|\\|)/', + '$1 0 ', trim(implode(' ', $terms)))); + if(!$code) return false; return @eval("return( $code );"); } $Conditions['expr'] = 'CondExpr($pagename, $condname, $condparm)'; |