mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 15:55:13 +00:00
quotes in image alt text - again
This commit is contained in:
parent
fcf28a99e9
commit
b0dfef6f49
1 changed files with 2 additions and 2 deletions
|
@ -4790,14 +4790,14 @@ class Activity
|
|||
}
|
||||
// Friendica attachment weirdness
|
||||
// Check both the attachment image and href since they can be different and the one in the href is a different link with different resolution.
|
||||
// Otheriwse you'll get duplicated images
|
||||
// Otherwise, you'll get duplicated images
|
||||
if (isset($a['image'])) {
|
||||
if (self::media_not_in_body($a['image'], $item['body']) && self::media_not_in_body($a['href'], $item['body'])) {
|
||||
if (isset($a['name']) && $a['name']) {
|
||||
$alt = htmlspecialchars($a['name'], ENT_QUOTES, 'UTF-8', false);
|
||||
// Escape brackets by converting to unicode full-width bracket since regular brackets will confuse multicode/bbcode parsing.
|
||||
// The full width bracket isn't quite as alien looking as most other unicode bracket replacements.
|
||||
$alt = str_replace(['[', ']'], ['[', ']'], $alt);
|
||||
$alt = str_replace(['[', ']', '"'], ['[', ']', '\"'], $alt);
|
||||
$item['body'] .= "\n\n" . '[img alt="' . $alt . '"]' . $a['href'] . '[/img]';
|
||||
} else {
|
||||
$item['body'] .= "\n\n" . '[img]' . $a['href'] . '[/img]';
|
||||
|
|
Loading…
Reference in a new issue