Skip to content

Commit 2bb07b9

Browse files
committed
Dodanie PHP 7.3
1 parent 3238758 commit 2bb07b9

File tree

6 files changed

+13
-28
lines changed

6 files changed

+13
-28
lines changed

docker/www/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.1-apache
1+
FROM php:7.3-apache
22

33
ARG XDEBUG_REMOTE_ENABLE=1
44
ARG XDEBUG_REMOTE_CONNECT_BACK=0

forum/qa-include/app/format.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ function qa_post_html_fields($post, $userid, $cookieid, $usershtml, $dummy, $opt
334334
if (@$options['categoryview'] && isset($post['categoryname']) && isset($post['categorybackpath'])) {
335335
$favoriteclass='';
336336

337-
if (count(@$favoritemap['category'])) {
337+
if (isset($favoritemap['category']) && count(@$favoritemap['category'])) {
338338
if (@$favoritemap['category'][$post['categorybackpath']])
339339
$favoriteclass=' qa-cat-favorited';
340340

@@ -1505,7 +1505,7 @@ function qa_set_display_rules(&$qa_content, $effects)
15051505
also combine multiple DOM IDs using JavaScript(=PHP) operators. This is twisted but rather convenient.
15061506
*/
15071507
{
1508-
$function='qa_display_rule_'.count(@$qa_content['script_lines']);
1508+
$function='qa_display_rule_'.count($qa_content['script_lines'] ?? []);
15091509

15101510
$keysourceids=array();
15111511

forum/qa-include/app/q-list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function qa_q_list_page_content($questions, $pagesize, $start, $count, $sometitl
110110
if (empty($qa_content['page_links']))
111111
$qa_content['suggest_next']=$suggest;
112112

113-
if (qa_using_categories() && count($navcategories) && isset($categorypathprefix))
113+
if (isset($navcategories, $categorypathprefix) && qa_using_categories() && count($navcategories))
114114
$qa_content['navigation']['cat']=qa_category_navigation($navcategories, $categoryid, $categorypathprefix, $categoryqcount, $categoryparams);
115115

116116
if (isset($feedpathprefix) && (qa_opt('feed_per_category') || !isset($categoryid)) )

forum/qa-include/qa-page.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -507,11 +507,12 @@ function qa_content_prepare($voting=false, $categoryids=null)
507507
$navpages=qa_db_get_pending_result('navpages');
508508
$widgets=qa_db_get_pending_result('widgets');
509509

510-
if (isset($categoryids) && !is_array($categoryids)) // accept old-style parameter
511-
$categoryids=array($categoryids);
512-
513-
$lastcategoryid=count($categoryids) ? end($categoryids) : null;
514-
$charset = 'utf-8';
510+
// accept old-style parameter
511+
if (isset($categoryids) && !is_array($categoryids)) {
512+
$categoryids = [$categoryids];
513+
$lastcategoryid = count($categoryids) ? end($categoryids) : null;
514+
}
515+
$charset = 'utf-8';
515516

516517
$qa_content=array(
517518
'content_type' => 'text/html; charset='.$charset,

forum/qa-include/qa-theme-base.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function widgets($region, $place)
174174
Output the widgets (as provided in $this->content['widgets']) for $region and $place
175175
*/
176176
{
177-
if (count(@$this->content['widgets'][$region][$place])) {
177+
if (isset($this->content['widgets'][$region][$place]) && count(@$this->content['widgets'][$region][$place])) {
178178
$this->output('<div class="qa-widgets-'.$region.' qa-widgets-'.$region.'-'.$place.'">');
179179

180180
foreach ($this->content['widgets'][$region][$place] as $module) {
@@ -573,7 +573,7 @@ public function nav_item($key, $navlink, $class, $level=null)
573573
(@$navlink['state'] ? (' qa-'.$class.'-'.$navlink['state']) : '').' qa-'.$class.'-'.$suffix.'">');
574574
$this->nav_link($navlink, $class);
575575

576-
if (count(@$navlink['subnav']))
576+
if (isset($navlink['subnav']) && count(@$navlink['subnav']))
577577
$this->nav_list($navlink['subnav'], $class, 1+$level);
578578

579579
$this->output('</li>');

forum/qa-include/vendor/PHPMailer/PHPMailerAutoload.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,4 @@ function PHPMailerAutoload($classname)
3030
}
3131
}
3232

33-
if (version_compare(PHP_VERSION, '5.1.2', '>=')) {
34-
//SPL autoloading was introduced in PHP 5.1.2
35-
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
36-
spl_autoload_register('PHPMailerAutoload', true, true);
37-
} else {
38-
spl_autoload_register('PHPMailerAutoload');
39-
}
40-
} else {
41-
/**
42-
* Fall back to traditional autoload for old PHP versions
43-
* @param string $classname The name of the class to load
44-
*/
45-
function __autoload($classname)
46-
{
47-
PHPMailerAutoload($classname);
48-
}
49-
}
33+
spl_autoload_register('PHPMailerAutoload', true, true);

0 commit comments

Comments
 (0)