mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 20:22:07 +00:00
Fix code
This commit is contained in:
@@ -141,7 +141,8 @@ 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])$/';
|
||||
if (false !== preg_match($pattern, $string)) {
|
||||
$result = preg_match($pattern, $string);
|
||||
if (false !== $result && 0 !== $result) {
|
||||
try {
|
||||
$date = new Carbon($parts[1]);
|
||||
} catch (\Exception $e) { // intentional generic exception
|
||||
@@ -178,7 +179,8 @@ 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])$/';
|
||||
if (false !== preg_match($pattern, $string)) {
|
||||
$result = preg_match($pattern, $string);
|
||||
if (false !== $result && 0 !== $result) {
|
||||
try {
|
||||
$date = new Carbon($parts[0]);
|
||||
} catch (\Exception $e) { // intentional generic exception
|
||||
|
Reference in New Issue
Block a user