Merge pull request #747 from MrPetovan/bug/mastodoncustomemojis-fix-notice

[mastodoncustomemojis] Ensure enoji array keys are set
This commit is contained in:
Michael Vogel 2018-10-12 14:57:47 +02:00 committed by GitHub
commit a8282d143e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,8 +96,10 @@ function mastodoncustomemojis_fetch_custom_emojis_for_url($api_base_url)
if (is_array($emojis_array) && count($emojis_array)) { if (is_array($emojis_array) && count($emojis_array)) {
foreach ($emojis_array as $emoji) { foreach ($emojis_array as $emoji) {
$return['texts'][] = ':' . $emoji['shortcode'] . ':'; if (!empty($emoji['shortcode']) && !empty($emoji['static_url'])) {
$return['icons'][] = '<img class="emoji mastodon" src="' . ProxyUtils::proxifyUrl($emoji['static_url']) . '" alt=":' . $emoji['shortcode'] . ':" title=":' . $emoji['shortcode'] . ':"/>'; $return['texts'][] = ':' . $emoji['shortcode'] . ':';
$return['icons'][] = '<img class="emoji mastodon" src="' . ProxyUtils::proxifyUrl($emoji['static_url']) . '" alt=":' . $emoji['shortcode'] . ':" title=":' . $emoji['shortcode'] . ':"/>';
}
} }
} }
} }