Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/Listener/LoadMenuEntriesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ public function handle(Event $event): void {
if ($menuEntry->getAdminRequired() === 1 && !$isUserAdmin) {
continue; // Skip this entry if the user is not an admin and the entry requires admin privileges
}
if ($menuEntry->getDisplayName() === '') {
// An entry without a label is not renderable, and translating an empty string
// throws since the L10N strict types refactoring.
continue;
}
$navigationManager->add(static function () use ($menuEntry) {
$appId = $menuEntry->getAppid();
$entryName = $menuEntry->getName();
Expand Down
7 changes: 5 additions & 2 deletions lib/Notifications/ExAppNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,13 @@ public function prepare(INotification $notification, string $languageCode): INot
}
$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath(Application::APP_ID, 'app-dark.svg')));

if (isset($parameters['rich_subject']) && isset($parameters['rich_subject_params'])) {
// Empty strings are rejected on both sides: `t('')` throws since the L10N strict types
// refactoring, and `setRichSubject('')`/`setRichMessage('')` throw an InvalidValueException.
// A notification without a message is valid, so skip what the ExApp did not provide.
if (isset($parameters['rich_subject'], $parameters['rich_subject_params']) && $parameters['rich_subject'] !== '') {
$notification->setRichSubject($l->t($parameters['rich_subject']), $parameters['rich_subject_params']);
}
if (isset($parameters['rich_message']) && isset($parameters['rich_message_params'])) {
if (isset($parameters['rich_message'], $parameters['rich_message_params']) && $parameters['rich_message'] !== '') {
$notification->setRichMessage($l->t($parameters['rich_message']), $parameters['rich_message_params']);
}

Expand Down
Loading