aboutsummaryrefslogtreecommitdiff
path: root/pmwiki.php
diff options
context:
space:
mode:
authorpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2024-04-08 08:16:44 +0000
committerpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2024-04-08 08:16:44 +0000
commite9d6817270fbd86e89c3743d2000d5906bdc222d (patch)
treeab87eca601fbd0732eab5106203c857902e8d8c0 /pmwiki.php
parent1da5b352ac11dfa301c93d7858de1bd71ca39eb1 (diff)
downloadpmwiki.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.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/pmwiki.php b/pmwiki.php
index 6afa5c7c..a72db3fa 100644
--- a/pmwiki.php
+++ b/pmwiki.php
@@ -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)';