Switching to Symfony Mailer (#629)

* Switching to Symfony Mailer

Additionally, support for all versions of PHP below 7.4 has been withdrawn

* Language variable for reply to

* Update to PHP 7.4
This commit is contained in:
Yury Pikhtarev 2023-03-20 01:26:26 +07:00 committed by GitHub
commit faf2306862
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 1450 additions and 584 deletions

View file

@ -21,14 +21,14 @@ function get_path_from_id($id, $ext_id, $base_path, $first_div, $sec_div)
function get_avatar_path($id, $ext_id, $base_path = null, $first_div = 10000, $sec_div = 100)
{
global $bb_cfg;
$base_path = $base_path ?? $bb_cfg['avatars']['upload_path'];
$base_path ??= $bb_cfg['avatars']['upload_path'];
return get_path_from_id($id, $ext_id, $base_path, $first_div, $sec_div);
}
function get_attach_path($id, $ext_id = '', $base_path = null, $first_div = 10000, $sec_div = 100)
{
global $bb_cfg;
$base_path = $base_path ?? $bb_cfg['attach']['upload_path'];
$base_path ??= $bb_cfg['attach']['upload_path'];
return get_path_from_id($id, $ext_id, $base_path, $first_div, $sec_div);
}
@ -762,7 +762,7 @@ function str_short($text, $max_length, $space = ' ')
if ($max_length && mb_strlen($text, 'UTF-8') > $max_length) {
$text = mb_substr($text, 0, $max_length, 'UTF-8');
if ($last_space_pos = $max_length - (int)strpos(strrev($text), $space)) {
if ($last_space_pos = $max_length - (int)strpos(strrev($text), (string) $space)) {
if ($last_space_pos > round($max_length * 3 / 4)) {
$last_space_pos--;
$text = mb_substr($text, 0, $last_space_pos, 'UTF-8');
@ -1559,7 +1559,7 @@ function get_topic_icon($topic, $is_unread = null)
global $bb_cfg, $images;
$t_hot = ($topic['topic_replies'] >= $bb_cfg['hot_threshold']);
$is_unread = $is_unread ?? is_unread($topic['topic_last_post_time'], $topic['topic_id'], $topic['forum_id']);
$is_unread ??= is_unread($topic['topic_last_post_time'], $topic['topic_id'], $topic['forum_id']);
if ($topic['topic_status'] == TOPIC_MOVED) {
$folder_image = $images['folder'];
@ -1638,7 +1638,7 @@ function get_poll_data_items_js($topic_id)
$items[$row['topic_id']][$row['vote_id']] = array($opt_text_for_js, $opt_result_for_js);
}
foreach ($items as $k => $v) {
$items[$k] = json_encode($v);
$items[$k] = json_encode($v, JSON_THROW_ON_ERROR);
}
return is_array($topic_id) ? $items : $items[$topic_id];