From e0225924e1c2cb6c901b8b7d291288c9fd162551 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 14 Feb 2022 10:52:11 -0300 Subject: [PATCH] https://github.com/WWBN/AVideo/issues/6283 Replace from about only if about is not empty --- feed/index.php | 5 ++++- objects/functions.php | 2 +- objects/user.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/feed/index.php b/feed/index.php index 5cee64a61b..a5b989be2b 100644 --- a/feed/index.php +++ b/feed/index.php @@ -26,7 +26,10 @@ if (!empty($_GET['channelName'])) { $user = User::getChannelOwner($_GET['channelName']); $showOnlyLoggedUserVideos = $user['id']; $title = User::getNameIdentificationById($user['id']); - $description = User::getDescriptionById($user['id'], true); + $about = User::getDescriptionById($user['id'], true); + if(!isHTMLEmpty($about)){ + $description = $about; + } $link = User::getChannelLink($user['id']); $logo = User::getPhoto($user['id']); } diff --git a/objects/functions.php b/objects/functions.php index 626c76bc76..dead0a1bec 100644 --- a/objects/functions.php +++ b/objects/functions.php @@ -7724,7 +7724,7 @@ function isImage($file) { } function isHTMLEmpty($html_string) { - return empty(trim(strip_specific_tags($html_string, ['br', 'p']))); + return empty(trim(str_replace(array("\r", "\n"), array('', ''), strip_specific_tags($html_string, ['br', 'p'])))); } function totalImageColors($image_path) { diff --git a/objects/user.php b/objects/user.php index 121df724b9..d6f823cbcc 100644 --- a/objects/user.php +++ b/objects/user.php @@ -388,7 +388,7 @@ if (typeof gtag !== \"function\") { $about = br2nl($about); $about = strip_tags($about); } - return $about; + return trim($about); } public static function getAboutFromId($id) {