Skip to content

Commit

Permalink
fix: give validation exception if they use emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbradley committed Jun 21, 2024
1 parent f4eefb9 commit 2dde46f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public function store(int $reportCycleId, int $teachingSetId, int $teacherId, Re
}

$data = $request->validate([
'reflection' => 'required|string|max:5000|min:10',
'reflection' => 'required|string|max:5000|min:10|regex:/\A(?!.*[:;]-\))[ -~]+\z/',
], [
'reflection.regex' => 'Please only use standard characters. No emojis or special characters.',
'reflection.required' => 'Please enter a reflection.',
'reflection.max' => 'You\'ve written a bit more than we expected. Please keep it to less than 5000 characters.',
'reflection.min' => 'To be meaningful, please write a longer reflection.',
Expand Down

0 comments on commit 2dde46f

Please sign in to comment.