Skip to content

Commit d6e7ea8

Browse files
committed
Fixed a PHP 8 warning due to missing updatepreview array entry
This was occurring when `build_postbit()` was called with a second argument of 1, 2, or 3.
1 parent 5c40c87 commit d6e7ea8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

root/inc/plugins/linktools.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@
9999
$plugins->add_hook('admin_config_settings_change' , 'lkt_hookin__admin_config_settings_change' );
100100
$plugins->add_hook('admin_settings_print_peekers' , 'lkt_hookin__admin_settings_print_peekers' );
101101
$plugins->add_hook('postbit' , 'lkt_hookin__postbit' );
102+
$plugins->add_hook('postbit' , 'lkt_hookin__postbit_etc' );
103+
$plugins->add_hook('postbit_prev' , 'lkt_hookin__postbit_etc' );
104+
$plugins->add_hook('postbit_pm' , 'lkt_hookin__postbit_etc' );
105+
$plugins->add_hook('postbit_announcement' , 'lkt_hookin__postbit_etc' );
102106
$plugins->add_hook('parse_message_start' , 'lkt_hookin__parse_message_start' );
103107
$plugins->add_hook('xmlhttp_update_post' , 'lkt_hookin__xmlhttp_update_post' );
104108
$plugins->add_hook('admin_config_menu' , 'lkt_hookin__admin_config_menu' );
@@ -3910,10 +3914,15 @@ function lkt_get_preview_regen_container($post, $urls) {
39103914
return $ret;
39113915
}
39123916

3917+
function lkt_hookin__postbit_etc($post) {
3918+
$post['updatepreview'] = '';
3919+
3920+
return $post;
3921+
}
3922+
39133923
function lkt_hookin__postbit($post) {
39143924
global $g_lkt_previews, $g_lkt_links_excl_vids;
39153925

3916-
$post['updatepreview'] = '';
39173926
if ($g_lkt_previews && empty($post['lkt_linkpreviewoff'])) {
39183927
$post['message'] = str_replace(array_keys($g_lkt_previews), array_values($g_lkt_previews), $post['message']);
39193928
$post['updatepreview'] = lkt_get_preview_regen_container($post, $g_lkt_links_excl_vids);

0 commit comments

Comments
 (0)