From 2e25ad5458f3a50270533f2800f82268e138bfe0 Mon Sep 17 00:00:00 2001 From: petko Date: Tue, 13 Aug 2024 09:52:35 +0000 Subject: Add helper function PRI(), update blocklist.php for PHP8. git-svn-id: svn://pmwiki.org/pmwiki/trunk@4763 524c5546-5005-0410-9a3e-e25e191bd360 --- pmwiki.php | 5 +++++ scripts/blocklist.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pmwiki.php b/pmwiki.php index 1b7e6b24..e71cf240 100644 --- a/pmwiki.php +++ b/pmwiki.php @@ -846,6 +846,11 @@ function PRCB($pat, $repl, $subj, $vars=null, $limit=-1, &$count=null, $flags=0) return preg_replace_callback($pat, $repl, $subj, $limit, $count, $flags); return preg_replace_callback($pat, $repl, $subj, $limit, $count); } +function PRI($glue, $array) { ## Recursive implode + $out = array(); + foreach($array as $v) $out[] = is_array($v)? PRI($glue, $v) : $v; + return implode($glue, $out); +} ## This is a replacement for json_encode+PHSC, but only for arrays that ## are used by the PmWiki core. It may or may not work in other cases. diff --git a/scripts/blocklist.php b/scripts/blocklist.php index 836ae999..c0571b34 100644 --- a/scripts/blocklist.php +++ b/scripts/blocklist.php @@ -46,7 +46,7 @@ ## but at some point we may change the default to disabled. if (IsEnabled($EnableBlocklistImmediate, 1)) { SDVA($BlocklistActions, array('comment' => 1)); - $ptext = implode(' ', @$_POST); + $ptext = PRI(' ', @$_POST); if ($ptext && @$BlocklistActions[$action]) { Blocklist($pagename, $ptext); if (!$EnablePost) { @@ -62,7 +62,7 @@ if (IsEnabled($EnableBlocklistImmediate, 1)) { ## periodically download the "moinmaster" blocklists. if ($EnableBlocklist >= 10) { SDVA($BlocklistDownload['SiteAdmin.Blocklist-MoinMaster'], array( - 'url' => 'http://moinmo.in/BadContent?action=raw', + 'url' => 'https://moinmo.in/BadContent?action=raw', 'format' => 'regex')); } -- cgit v1.2.3