From 7f52c750a4fc52d80261bb5f8abaa794995cd141 Mon Sep 17 00:00:00 2001 From: Sergei K Date: Sat, 14 Aug 2021 00:03:43 +0500 Subject: [PATCH] PHP 7/8 compatibility fixes --- include/admin/PhorumInputForm.php | 4 +- include/admin/badwords.php | 2 +- include/admin/upgrade.php | 1 + include/api/custom_field.php | 2 +- include/api/system.php | 2 +- include/db/PhorumDB.php | 2 + include/misc/polyfill-each.php | 54 +++++++++++++++++++ .../ConvertCharset.class.full.php | 2 +- .../ConvertCharset.class.php | 1 + mods/spamhurdles/api.php | 6 +-- mods/spamhurdles/captcha/class.banner.php | 2 +- .../captcha/class.captcha_base.php | 4 +- mods/spamhurdles/include/crypt/aes.php | 4 +- mods/spamhurdles/include/crypt/rijndael.php | 2 +- 14 files changed, 73 insertions(+), 15 deletions(-) create mode 100644 include/misc/polyfill-each.php diff --git a/include/admin/PhorumInputForm.php b/include/admin/PhorumInputForm.php index 9ad733293..3f17956b5 100644 --- a/include/admin/PhorumInputForm.php +++ b/include/admin/PhorumInputForm.php @@ -39,7 +39,7 @@ class PhorumInputForm { var $_submit; var $_help; - function PhorumInputForm ( $action = "", $method = "get", $submit = "Submit", $target = "", $enctype = "", $events = array() ) + function __construct($action = "", $method = "get", $submit = "Submit", $target = "", $enctype = "", $events = array()) { $this->_action = ( empty( $action ) ) ? $_SERVER["PHP_SELF"] : $action; $this->_method = $method; @@ -208,7 +208,7 @@ function show() { global $PHORUM; - if(count($this->_help)){ + if (is_array($this->_help) && count($this->_help)) { echo "