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('