Include safe methods and require the correct package.

This commit is contained in:
James Cole
2025-05-11 14:19:07 +02:00
parent 4af2aadc48
commit 9a02739251
61 changed files with 295 additions and 294 deletions

View File

@@ -143,7 +143,7 @@ class ReportFormRequest extends FormRequest
// validate as date
// if regex for YYYY-MM-DD:
$pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
$result = preg_match($pattern, $string);
$result = \Safe\preg_match($pattern, $string);
if (false !== $result && 0 !== $result) {
try {
$date = new Carbon($parts[1]);
@@ -181,7 +181,7 @@ class ReportFormRequest extends FormRequest
// validate as date
// if regex for YYYY-MM-DD:
$pattern = '/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][\d]|3[01])$/';
$result = preg_match($pattern, $string);
$result = \Safe\preg_match($pattern, $string);
if (false !== $result && 0 !== $result) {
try {
$date = new Carbon($parts[0]);