From 1e85985a0c4e7a98fb58d9c177da57b08a443652 Mon Sep 17 00:00:00 2001 From: Matthieu Leproux Date: Tue, 26 Jul 2022 14:30:39 +0200 Subject: [PATCH] related to #1693 php8.1 compat for comments in gallery and album edit in admin --- admin/element_set_ranks.php | 2 +- admin/themes/default/template/album_notification.tpl | 2 +- comments.php | 4 ++-- include/functions_html.inc.php | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/admin/element_set_ranks.php b/admin/element_set_ranks.php index eee02384e..f097cc4e5 100644 --- a/admin/element_set_ranks.php +++ b/admin/element_set_ranks.php @@ -203,7 +203,7 @@ $sort_fields = array( $template->assign('image_order_options', $sort_fields); -$image_order = explode(',', $category['image_order']); +$image_order = explode(',', isset($category['image_order']) ? $category['image_order'] : ""); for ($i=0; $i<3; $i++) // 3 fields { diff --git a/admin/themes/default/template/album_notification.tpl b/admin/themes/default/template/album_notification.tpl index a6dd82980..6b65b3668 100644 --- a/admin/themes/default/template/album_notification.tpl +++ b/admin/themes/default/template/album_notification.tpl @@ -104,7 +104,7 @@ span.errors {

{'Complementary mail content'|@translate}
- +

{if isset($auth_key_duration)} diff --git a/comments.php b/comments.php index 0029d0082..ab0f8e852 100644 --- a/comments.php +++ b/comments.php @@ -285,8 +285,8 @@ $template->set_filenames(array('comments'=>'comments.tpl', 'comment_list'=>'comm $template->assign( array( 'F_ACTION'=>PHPWG_ROOT_PATH.'comments.php', - 'F_KEYWORD'=> htmlspecialchars(stripslashes(@$_GET['keyword'])), - 'F_AUTHOR'=> htmlspecialchars(stripslashes(@$_GET['author'])), + 'F_KEYWORD'=> isset($_GET['keyword']) ? htmlspecialchars(stripslashes($_GET['keyword'])) : "", + 'F_AUTHOR'=> isset($_GET['author']) ? htmlspecialchars(stripslashes($_GET['author'])) : "", ) ); diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index 39247d69b..8ba7051f0 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -532,6 +532,7 @@ function set_status_header($code, $text='') */ function render_category_literal_description($desc) { + !isset($desc) ? $desc = "" : false; return strip_tags($desc, '


'); }