Merge branch 'develop' into refactoring-of-app-class

This commit is contained in:
Art4 2024-11-16 19:29:56 +00:00
commit a24a65de2f
561 changed files with 64963 additions and 61342 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="" class="empty-description"/>',
$newbody
);
$cnt++;
@ -849,6 +849,7 @@ class BBCode
$img_str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_COMPAT) . '"';
}
}
$img_str .= ' ' . empty($attributes['alt']) ? 'class="empty-description"' : 'class="has-alt-description"';
return $img_str . '>';
},
$text
@ -920,6 +921,7 @@ class BBCode
$contact = Contact::getByURL($attributes['profile'], false, ['network']);
$network = $contact['network'] ?? Protocol::PHANTOM;
$gsid = ContactSelector::getServerIdForProfile($attributes['profile']);
$tpl = Renderer::getMarkupTemplate('shared_content.tpl');
$text .= self::SHARED_ANCHOR . Renderer::replaceMacros($tpl, [
'$profile' => $attributes['profile'],
@ -929,8 +931,8 @@ class BBCode
'$link_title' => DI::l10n()->t('Link to source'),
'$posted' => $attributes['posted'],
'$guid' => $attributes['guid'],
'$network_name' => ContactSelector::networkToName($network, $attributes['profile']),
'$network_icon' => ContactSelector::networkToIcon($network, $attributes['profile']),
'$network_name' => ContactSelector::networkToName($network, '', $gsid),
'$network_svg' => ContactSelector::networkToSVG($network, $gsid),
'$content' => self::TOP_ANCHOR . self::setMentions(trim($content), 0, $network) . self::BOTTOM_ANCHOR,
]);
break;
@ -1826,8 +1828,8 @@ class BBCode
$text
);
$text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="width: $1px;" >', $text);
$text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: $1px;" >', $text);
$text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '<img src="$3" style="width: $1px;" alt="" class="empty-description">', $text);
$text = preg_replace("/\[zmg\=([0-9]*)x([0-9]*)\](.*?)\[\/zmg\]/ism", '<img class="zrl" src="$3" style="width: $1px;" alt="" class="empty-description">', $text);
$text = preg_replace_callback(
"/\[[iz]mg\=(.*?)\](.*?)\[\/[iz]mg\]/ism",
@ -1836,7 +1838,7 @@ class BBCode
$alt = htmlspecialchars($matches[2], ENT_COMPAT);
// Fix for Markdown problems with Diaspora, see issue #12701
if (($simple_html != self::DIASPORA) || strpos($matches[2], '"') === false) {
return '<img src="' . $matches[1] . '" alt="' . $alt . '" title="' . $alt . '">';
return '<img src="' . $matches[1] . '" alt="' . $alt . '" title="' . $alt . '" class="' . (empty($alt) ? 'empty-description' : 'has-alt-description') . '">';
} else {
return '<img src="' . $matches[1] . '" alt="' . $alt . '">';
}
@ -1859,8 +1861,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="" class="empty-description"/>', $text);
$text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img src="$1" alt="" class="empty-description" />', $text);
$text = self::convertImages($text, $simple_html, $uriid);