ソースを参照

マンコ

pull/16/head
コミット
58baabbd39
  1. 3
      app/Http/Controllers/Home/Contact.php

3
app/Http/Controllers/Home/Contact.php

@ -79,7 +79,7 @@ class Contact {
Storage::disk('public')->put($filename, $this->field['gpg']);
$path = Storage::disk('public')->path($filename);
$verifygpg = explode("\n", $this->run('gpg --dry-run --import '.$path))[0];
if (!str_contains($verifygpg, '処理数の合計: 1')) $err[] = $verifygpg;
if (!str_contains($verifygpg, '処理数の合計: 1') && !str_contains($verifygpg, 'Total number processed: 1')) $err[] = $verifygpg;
}
// 文章
@ -106,6 +106,7 @@ class Contact {
Mail::to(config('mail.from.address'))->send(new ContactNotifyMail($this->field, $filename));
} catch (\Throwable $e) {
Storage::disk('public')->delete($filename);
$this->field['bunsyo'] = $gpg->decrypt($this->field['bunsyo']);
Log::critical($e);
return view('pages.site.contact', ['field' => $this->field, 'err' => ['送信に失敗しました。数時間後もう一回送信してみて下さい。']]);
}

読み込み中…
キャンセル
保存