Issue 14174 and 14421: Option to hide emojis and pictures without description

This commit is contained in:
Michael 2024-10-18 19:00:13 +00:00
parent 159e6e79dc
commit 301717802d
7 changed files with 245 additions and 206 deletions

View file

@ -686,7 +686,7 @@ class BBCode
// to the last element
$newbody = str_replace(
'[$#saved_image' . $cnt . '#$]',
'<img src="' . self::proxyUrl($image, self::INTERNAL, $uriid) . '" alt="' . DI::l10n()->t('Image/photo') . '" />',
'<img src="' . self::proxyUrl($image, self::INTERNAL, $uriid) . '" alt="' . DI::l10n()->t('Image/photo') . '" class="empty-description"/>',
$newbody
);
$cnt++;
@ -1859,8 +1859,8 @@ class BBCode
$text
);
$text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . DI::l10n()->t('Image/photo') . '" />', $text);
$text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . DI::l10n()->t('Image/photo') . '" />', $text);
$text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img src="$1" alt="' . DI::l10n()->t('Image/photo') . '" class="empty-description"/>', $text);
$text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="' . DI::l10n()->t('Image/photo') . '" class="empty-description" />', $text);
$text = self::convertImages($text, $simple_html, $uriid);