We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3412a7 commit bd31e4bCopy full SHA for bd31e4b
1 file changed
src/Receiver.php
@@ -41,13 +41,7 @@ public function __construct(
41
$this->purpose = $purpose;
42
$this->personalAccount = $personalAccount;
43
44
- $formattedDate = \DateTime::createFromFormat(
45
- 'm/Y',
46
- $period,
47
- new DateTimeZone(date_default_timezone_get())
48
- );
49
-
50
- if ($formattedDate === false || $period !== $formattedDate->format('m/Y')) {
+ if (preg_match('~^(0[1-9]|1[0-2])\/\d{4}$~', $period)) {
51
throw new PaymentException('Аргумент period имеет неверный формат');
52
}
53
0 commit comments