aboutsummaryrefslogtreecommitdiff
path: root/scripts
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 /scripts
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 'scripts')
-rw-r--r--scripts/markupexpr.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/markupexpr.php b/scripts/markupexpr.php
index 69d456be..7f7de79b 100644
--- a/scripts/markupexpr.php
+++ b/scripts/markupexpr.php
@@ -1,5 +1,5 @@
<?php if (!defined('PmWiki')) exit();
-/* Copyright 2007-2021 Patrick R. Michaud (pmichaud@pobox.com)
+/* Copyright 2007-2024 Patrick R. Michaud (pmichaud@pobox.com)
This file is part of PmWiki; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License, or
@@ -108,7 +108,9 @@ function MarkupExpression($pagename, $expr) {
## fix any quoted arguments
foreach ($argp as $k => $v)
if (!is_array($v)) $argp[$k] = preg_replace_callback($rpat, 'cb_expandkpv', $v);
- $out = eval("return ({$code});");
+ $code = trim(strval($code));
+ if($code === '') $out = '';
+ else $out = eval("return ({$code});");
if ($expr == $repl) { $expr = $out; break; }
$expr = str_replace($repl, Keep($out, 'P'), $expr);
}