diff --git a/docker/www/Dockerfile b/docker/www/Dockerfile index 66d2d2523..d6490cf8a 100644 --- a/docker/www/Dockerfile +++ b/docker/www/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.1-apache +FROM php:7.3-apache-stretch ARG XDEBUG_REMOTE_ENABLE=1 ARG XDEBUG_REMOTE_CONNECT_BACK=0 diff --git a/forum/qa-include/app/format.php b/forum/qa-include/app/format.php index b5a370255..03a6c3c93 100644 --- a/forum/qa-include/app/format.php +++ b/forum/qa-include/app/format.php @@ -334,7 +334,7 @@ function qa_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt if (@$options['categoryview'] && isset($post['categoryname']) && isset($post['categorybackpath'])) { $favoriteclass=''; - if (count(@$favoritemap['category'])) { + if (isset($favoritemap['category']) && count(@$favoritemap['category'])) { if (@$favoritemap['category'][$post['categorybackpath']]) $favoriteclass=' qa-cat-favorited'; @@ -1507,7 +1507,7 @@ function qa_set_display_rules(&$qa_content, $effects) also combine multiple DOM IDs using JavaScript(=PHP) operators. This is twisted but rather convenient. */ { - $function='qa_display_rule_'.count(@$qa_content['script_lines']); + $function='qa_display_rule_'.count($qa_content['script_lines'] ?? []); $keysourceids=array(); diff --git a/forum/qa-include/app/q-list.php b/forum/qa-include/app/q-list.php index b844b69f3..9c71cc9f1 100644 --- a/forum/qa-include/app/q-list.php +++ b/forum/qa-include/app/q-list.php @@ -110,7 +110,7 @@ function qa_q_list_page_content($questions, $pagesize, $start, $count, $sometitl if (empty($qa_content['page_links'])) $qa_content['suggest_next']=$suggest; - if (qa_using_categories() && count($navcategories) && isset($categorypathprefix)) + if (isset($navcategories, $categorypathprefix) && qa_using_categories() && count($navcategories)) $qa_content['navigation']['cat']=qa_category_navigation($navcategories, $categoryid, $categorypathprefix, $categoryqcount, $categoryparams); if (isset($feedpathprefix) && (qa_opt('feed_per_category') || !isset($categoryid)) ) diff --git a/forum/qa-include/qa-page.php b/forum/qa-include/qa-page.php index 4c127747b..ca6257642 100644 --- a/forum/qa-include/qa-page.php +++ b/forum/qa-include/qa-page.php @@ -517,11 +517,12 @@ function qa_content_prepare($voting=false, $categoryids=null) $navpages=qa_db_get_pending_result('navpages'); $widgets=qa_db_get_pending_result('widgets'); - if (isset($categoryids) && !is_array($categoryids)) // accept old-style parameter - $categoryids=array($categoryids); - - $lastcategoryid=count($categoryids) ? end($categoryids) : null; - $charset = 'utf-8'; + // accept old-style parameter + if (isset($categoryids) && !is_array($categoryids)) { + $categoryids = [$categoryids]; + $lastcategoryid = count($categoryids) ? end($categoryids) : null; + } + $charset = 'utf-8'; $qa_content=array( 'content_type' => 'text/html; charset='.$charset, diff --git a/forum/qa-include/qa-theme-base.php b/forum/qa-include/qa-theme-base.php index b48fca095..726c6ed7c 100644 --- a/forum/qa-include/qa-theme-base.php +++ b/forum/qa-include/qa-theme-base.php @@ -174,7 +174,7 @@ public function widgets($region, $place) Output the widgets (as provided in $this->content['widgets']) for $region and $place */ { - if (count(@$this->content['widgets'][$region][$place])) { + if (isset($this->content['widgets'][$region][$place]) && count(@$this->content['widgets'][$region][$place])) { $this->output('
'); foreach ($this->content['widgets'][$region][$place] as $module) { @@ -574,7 +574,7 @@ public function nav_item($key, $navlink, $class, $level=null) (@$navlink['state'] ? (' qa-'.$class.'-'.$navlink['state']) : '').' qa-'.$class.'-'.$suffix.'">'); $this->nav_link($navlink, $class); - if (count(@$navlink['subnav'])) + if (isset($navlink['subnav']) && count(@$navlink['subnav'])) $this->nav_list($navlink['subnav'], $class, 1+$level); $this->output(''); diff --git a/forum/qa-include/vendor/PHPMailer/PHPMailerAutoload.php b/forum/qa-include/vendor/PHPMailer/PHPMailerAutoload.php index ac47f4520..5ab42df12 100644 --- a/forum/qa-include/vendor/PHPMailer/PHPMailerAutoload.php +++ b/forum/qa-include/vendor/PHPMailer/PHPMailerAutoload.php @@ -30,20 +30,4 @@ function PHPMailerAutoload($classname) } } -if (version_compare(PHP_VERSION, '5.1.2', '>=')) { - //SPL autoloading was introduced in PHP 5.1.2 - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - spl_autoload_register('PHPMailerAutoload', true, true); - } else { - spl_autoload_register('PHPMailerAutoload'); - } -} else { - /** - * Fall back to traditional autoload for old PHP versions - * @param string $classname The name of the class to load - */ - function __autoload($classname) - { - PHPMailerAutoload($classname); - } -} +spl_autoload_register('PHPMailerAutoload', true, true); diff --git a/forum/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php b/forum/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php index 76be6fd05..3d99acb8e 100644 --- a/forum/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php +++ b/forum/qa-plugin/q2apro-on-site-notifications/q2apro-onsitenotifications-page.php @@ -226,7 +226,7 @@ public function process_request($request) $itemIcon = '
'; break; default: - continue; + continue 2; } }