Skip to content

Commit

Permalink
メールフォーム受付期間のpublish_endにバリデーション追加 fix #4000
Browse files Browse the repository at this point in the history
  • Loading branch information
maenoasuka committed Dec 3, 2024
1 parent 7a938a4 commit cacce7d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plugins/bc-mail/src/Model/Table/MailContentsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,23 @@ public function validationDefault(Validator $validator): Validator
]
]);

// publish_end
$validator
->add('publish_end', [
'dateTime' => [
'rule' => ['dateTime'],
'message' => __d('baser_core', '公開終了日に不正な文字列が入っています。')
]
])
->allowEmptyDateTime('publish_end')
->add('publish_end', [
'checkDateAfterThan' => [
'rule' => ['checkDateAfterThan', 'publish_begin'],
'provider' => 'bc',
'message' => __d('baser_core', '公開終了日は、公開開始日より新しい日付で入力してください。')
]
]);

// sender_1
$validator
->scalar('sender_1')
Expand Down

0 comments on commit cacce7d

Please sign in to comment.