From 4f648db5109e74ccfc7dfeac4badf5213be0f8cb Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 19 Nov 2025 16:09:50 +0100 Subject: [PATCH] issue #2445 avoid null input on strip_tags (image name can be null) --- include/ws_functions/pwg.categories.php | 2 +- include/ws_functions/pwg.images.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ws_functions/pwg.categories.php b/include/ws_functions/pwg.categories.php index 7fa4c36b2..83dae6689 100644 --- a/include/ws_functions/pwg.categories.php +++ b/include/ws_functions/pwg.categories.php @@ -132,7 +132,7 @@ SELECT SQL_CALC_FOUND_ROWS i.* $image[$k] = $row[$k]; } - $image['name'] = strip_tags(trigger_change('render_element_name', $image['name'], __FUNCTION__)); + $image['name'] = strip_tags(trigger_change('render_element_name', $image['name'], __FUNCTION__) ?? ''); $image['comment'] = trigger_change('render_element_description', $image['comment'], __FUNCTION__); $image = array_merge($image, ws_std_get_urls($row)); diff --git a/include/ws_functions/pwg.images.php b/include/ws_functions/pwg.images.php index 76176c962..54a58d4dc 100644 --- a/include/ws_functions/pwg.images.php +++ b/include/ws_functions/pwg.images.php @@ -396,7 +396,7 @@ LIMIT 1 'render_element_name', $image_row['name'], __FUNCTION__ - ) + ) ?? '' ); $image_row['comment_raw'] = $image_row['comment']; @@ -717,7 +717,7 @@ SELECT * $image[$k] = $row[$k]; } - $image['name'] = strip_tags(trigger_change('render_element_name', $image['name'], __FUNCTION__)); + $image['name'] = strip_tags(trigger_change('render_element_name', $image['name'], __FUNCTION__) ?? ''); $image['comment'] = trigger_change('render_element_description', $image['comment'], __FUNCTION__); $image = array_merge($image, ws_std_get_urls($row));