From d2aa68106b89a193c00133291a0c9b4cfc63f388 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 21 Jun 2020 09:45:00 -0400 Subject: [PATCH] Make guid attribute available to convertShare callback --- src/Content/Text/BBCode.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 266182b3b8..7354e06451 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -978,7 +978,7 @@ class BBCode function ($match) use ($callback) { $attribute_string = $match[2]; $attributes = []; - foreach (['author', 'profile', 'avatar', 'link', 'posted'] as $field) { + foreach (['author', 'profile', 'avatar', 'link', 'posted', 'guid'] as $field) { preg_match("/$field=(['\"])(.+?)\\1/ism", $attribute_string, $matches); $attributes[$field] = html_entity_decode($matches[2] ?? '', ENT_QUOTES, 'UTF-8'); } @@ -1088,6 +1088,7 @@ class BBCode '$link' => $attributes['link'], '$link_title' => DI::l10n()->t('link to source'), '$posted' => $attributes['posted'], + '$guid' => $attributes['guid'], '$network_name' => ContactSelector::networkToName($contact['network'], $attributes['profile']), '$network_icon' => ContactSelector::networkToIcon($contact['network'], $attributes['profile']), '$content' => self::setMentions(trim($content), 0, $contact['network']),