Skip to content

Commit

Permalink
Revert "Use an array for the avatar string"
Browse files Browse the repository at this point in the history
This reverts commit 017d517.
  • Loading branch information
iMattPro committed May 17, 2024
1 parent 017d517 commit 0da7c8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions notification/method/webpush.php
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ protected function clean_expired_subscriptions(array $user_subscription_map, arr
* into https://myboard.url/path/to/avatar=123456789.gif
*
* @param string $avatar
* @return array Absolute path to avatar image in an array with src as its key
* @return string Absolute path to avatar image
*/
protected function prepare_avatar($avatar)
{
Expand All @@ -455,7 +455,7 @@ protected function prepare_avatar($avatar)

$path = !empty($matches[1]) ? end($matches[1]) : $avatar;

return ['src' => preg_replace('#^' . preg_quote($this->path_helper->get_web_root_path(), '#') . '#', $this->get_board_url(), $path, 1)];
return preg_replace('#^' . preg_quote($this->path_helper->get_web_root_path(), '#') . '#', $this->get_board_url(), $path, 1);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion styles/all/template/push_worker.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ self.addEventListener('push', event => {
const options = {
body: responseBody,
data: response,
icon: response.avatar.src,
icon: response.avatar,
};
self.registration.showNotification(response.heading, options);
});
Expand Down

0 comments on commit 0da7c8a

Please sign in to comment.