Skip to content

Commit 186da57

Browse files
committed
bug #60745 [Scheduler] Add validation for comma-separated weekdays in PeriodicalTrigger
1 parent 6317c59 commit 186da57

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/Symfony/Component/Scheduler/Tests/Trigger/PeriodicalTriggerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public static function getInvalidIntervals(): iterable
7676
yield [-3600, 'The "$interval" argument must be greater than zero.'];
7777
yield ['0', 'The "$interval" argument must be greater than zero.'];
7878
yield [0, 'The "$interval" argument must be greater than zero.'];
79+
yield ['Monday, Thursday, Saturday', 'Comma-separated values are not supported'];
7980
}
8081

8182
/**

src/Symfony/Component/Scheduler/Trigger/PeriodicalTrigger.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ public function __construct(
5151

5252
$i = $interval;
5353
if (\is_string($interval)) {
54+
if (\str_contains($interval, ',')) {
55+
throw new InvalidArgumentException(\sprintf('Invalid interval "%s": Comma-separated values are not supported', $interval));
56+
}
57+
5458
$this->description = \sprintf('every %s', $interval);
5559
$i = @\DateInterval::createFromDateString($interval);
5660

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy