From 7c5903be70ea82085de4debac21af403450f26bb Mon Sep 17 00:00:00 2001 From: petko Date: Mon, 12 Aug 2024 14:30:17 +0000 Subject: Update for PHP 8. PmSyntax fix line-height for some skin configurations. git-svn-id: svn://pmwiki.org/pmwiki/trunk@4761 524c5546-5005-0410-9a3e-e25e191bd360 --- pmwiki.php | 5 +++-- pub/guiedit/pmwiki.syntax.css | 3 +++ scripts/pmform.php | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pmwiki.php b/pmwiki.php index a8c2a36b..1b7e6b24 100644 --- a/pmwiki.php +++ b/pmwiki.php @@ -1507,6 +1507,7 @@ function FmtGroupHome($pn,$group,$var) { ## {$$key} in $text with $vars['key']. function FmtTemplateVars($text, $vars, $pagename = NULL) { global $FmtPV, $EnableUndefinedTemplateVars; + $text = strval($text); if ($pagename) { $pat = implode('|', array_map('preg_quote', array_keys($FmtPV))); $pprc = new PPRC($pagename); @@ -1514,8 +1515,8 @@ function FmtTemplateVars($text, $vars, $pagename = NULL) { array($pprc, 'pagevar'), $text); } foreach(preg_grep('/^[\\w$]/', array_keys($vars)) as $k) - if (!is_array($vars[$k])) - $text = str_replace("{\$\$$k}", @$vars[$k], $text); + if (!is_array($vars[$k]) && $text) + $text = str_replace("{\$\$$k}", strval(@$vars[$k]), $text); if (! IsEnabled($EnableUndefinedTemplateVars, 0)) $text = preg_replace("/\\{\\$\\$\\w+\\}/", '', $text); return $text; diff --git a/pub/guiedit/pmwiki.syntax.css b/pub/guiedit/pmwiki.syntax.css index 9a3066f3..e1b641dd 100644 --- a/pub/guiedit/pmwiki.syntax.css +++ b/pub/guiedit/pmwiki.syntax.css @@ -252,6 +252,9 @@ code.pmhlt, .pmhlt code, #htext.pmhlt { word-wrap: break-word; overflow-wrap: break-word; } +#wikiedit #htext * { + line-height: var(--pmsyntax-lineheight); +} #wikiedit #hwrap #htext { display: none; position: absolute; diff --git a/scripts/pmform.php b/scripts/pmform.php index 918da0d2..32fdcce4 100644 --- a/scripts/pmform.php +++ b/scripts/pmform.php @@ -61,7 +61,7 @@ function PmFormConfig($pagename, $target) { function PmFormTemplateDirective($text, $pat, &$match) { $pat = "/((?<=\n) *)?\\(:template +$pat\\b(.*?):\\)(?(1) *\n)/"; - return preg_match_all($pat, $text, $match, PREG_SET_ORDER); + return preg_match_all($pat, strval(@$text), $match, PREG_SET_ORDER); } -- cgit v1.2.3