Skip to content

Commit

Permalink
Merge pull request #9 from kenjis/fix-bbs
Browse files Browse the repository at this point in the history
画像キャプチャのチェック漏れの修正
  • Loading branch information
kenjis authored Mar 21, 2021
2 parents 4d5e1f1 + f537815 commit 67daa08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/Controllers/Bbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,13 @@ public function insert(): ?RedirectResponse
$form = new PostForm();
$formValidation = new FormValidation(Services::validation());

// 検証にパスした場合は、送られたデータとIPアドレスをbbsテーブルに登録します
if ($formValidation->validate($this->request, $form)) {
// 検証にパスした場合は、bbsテーブルに登録します
if ($formValidation->validate($this->request, $form, 'confirm')) {
$data = $form->asArray();
// 不要な項目を削除
unset($data['captcha']);
unset($data['key']);
// IPアドレスを追加
$data['ip_address'] = $this->request->getServer('REMOTE_ADDR');

$this->insertToDb($data);
Expand Down

0 comments on commit 67daa08

Please sign in to comment.