aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2024-08-13 09:52:35 +0000
committerpetko <petko@524c5546-5005-0410-9a3e-e25e191bd360>2024-08-13 09:52:35 +0000
commit2e25ad5458f3a50270533f2800f82268e138bfe0 (patch)
treecf8db028582749a84847adbe6514edc76bc77578
parent1c6a229cc97262a7e1527cc7e8721cdfd0d8c29a (diff)
downloadpmwiki.svn-2e25ad5458f3a50270533f2800f82268e138bfe0.tar.bz2
Add helper function PRI(), update blocklist.php for PHP8.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4763 524c5546-5005-0410-9a3e-e25e191bd360
-rw-r--r--pmwiki.php5
-rw-r--r--scripts/blocklist.php4
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'));
}