Merge pull request #13047 from MrPetovan/bug/13043-Notify-msg-null

Account for null value in Entity\Notify->msg
This commit is contained in:
Tobias Diekershoff 2023-04-28 07:12:54 +02:00 committed by GitHub
commit b271b3aa27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -61,15 +61,15 @@ class Notify extends BaseEntity
protected $photo; protected $photo;
/** @var DateTime */ /** @var DateTime */
protected $date; protected $date;
/** @var string */ /** @var string|null */
protected $msg; protected $msg;
/** @var int */ /** @var int */
protected $uid; protected $uid;
/** @var UriInterface */ /** @var UriInterface */
protected $link; protected $link;
/** @var int */ /** @var int|null */
protected $itemId; protected $itemId;
/** @var int */ /** @var int|null */
protected $parent; protected $parent;
/** @var bool */ /** @var bool */
protected $seen; protected $seen;
@ -79,13 +79,13 @@ class Notify extends BaseEntity
protected $otype; protected $otype;
/** @var string */ /** @var string */
protected $name_cache; protected $name_cache;
/** @var string */ /** @var string|null */
protected $msg_cache; protected $msg_cache;
/** @var int|null */ /** @var int|null */
protected $uriId; protected $uriId;
/** @var int|null */ /** @var int|null */
protected $parentUriId; protected $parentUriId;
/** @var int */ /** @var int|null */
protected $id; protected $id;
public function __construct(int $type, string $name, UriInterface $url, UriInterface $photo, DateTime $date, int $uid, UriInterface $link, bool $seen, string $verb, string $otype, string $name_cache, string $msg = null, string $msg_cache = null, int $itemId = null, int $uriId = null, int $parent = null, ?int $parentUriId = null, ?int $id = null) public function __construct(int $type, string $name, UriInterface $url, UriInterface $photo, DateTime $date, int $uid, UriInterface $link, bool $seen, string $verb, string $otype, string $name_cache, string $msg = null, string $msg_cache = null, int $itemId = null, int $uriId = null, int $parent = null, ?int $parentUriId = null, ?int $id = null)

View File

@ -222,7 +222,7 @@ class FormattedNotify extends BaseFactory
$this->baseUrl . '/notify/' . $Notify->id, $this->baseUrl . '/notify/' . $Notify->id,
Contact::getAvatarUrlForUrl($Notify->url, $Notify->uid, Proxy::SIZE_MICRO), Contact::getAvatarUrlForUrl($Notify->url, $Notify->uid, Proxy::SIZE_MICRO),
$Notify->url, $Notify->url,
strip_tags(BBCode::toPlaintext($Notify->msg)), strip_tags(BBCode::toPlaintext($Notify->msg ?? '')),
DateTimeFormat::local($Notify->date->format(DateTimeFormat::MYSQL), 'r'), DateTimeFormat::local($Notify->date->format(DateTimeFormat::MYSQL), 'r'),
Temporal::getRelativeDate($Notify->date->format(DateTimeFormat::MYSQL)), Temporal::getRelativeDate($Notify->date->format(DateTimeFormat::MYSQL)),
$Notify->seen $Notify->seen