Skip to content
Open
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
2 changes: 1 addition & 1 deletion src/Http/Controller/ExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
200,
[
'Content-Type' => 'application/zip',
'Content-Length' => $this->storageManager->getStoredExportSize($export),
'Content-Length' => (string) $this->storageManager->getStoredExportSize($export),
'Content-Disposition' => 'attachment; filename="data-export-'.$export->user->username.'-'.$export->created_at->toIso8601String().'.zip"',
]
);
Expand Down
7 changes: 7 additions & 0 deletions src/Jobs/ErasureJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Flarum\Gdpr\Models\ErasureRequest;
use Flarum\Gdpr\Notifications\ErasureCompletedBlueprint;
use Flarum\Http\UrlGenerator;
use Flarum\Locale\Translator;
use Flarum\Settings\SettingsRepositoryInterface;
use Flarum\User\User;
use Illuminate\Contracts\Events\Dispatcher;
Expand Down Expand Up @@ -84,6 +85,12 @@ public function handle(
$this->erasureRequest
));

// Capture the user's locale on the shared translator before
// anonymization wipes their preferences. The completion email below
// re-uses the same translator instance, so this carries through.
/** @var TranslatorInterface&Translator $translator */
$translator->setLocale($user->getPreference('locale') ?? $this->settings->get('default_locale'));

$this->{$mode}($user, $processor);

$this->sendUserConfirmation($mode, $username, $email, $mailer, $translator);
Expand Down
Loading