File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,7 @@ public function filter(array $jobs, $time = null)
173
173
protected function process ($ expr , $ time )
174
174
{
175
175
$ expr = $ this ->normalizeExpr ($ expr );
176
- $ expr = \str_ireplace (\array_keys (static ::$ literals ), \array_values (static ::$ literals ), $ expr );
177
- $ expr = \explode (' ' , $ expr );
176
+ $ expr = \preg_split ('~\s+~ ' , $ expr ); # 14
178
177
179
178
if (\count ($ expr ) < 5 || \count ($ expr ) > 6 ) {
180
179
throw new \UnexpectedValueException (
@@ -203,10 +202,16 @@ protected function normalizeTime($time)
203
202
204
203
protected function normalizeExpr ($ expr )
205
204
{
205
+ $ expr = \trim ($ expr );
206
+
206
207
if (isset (static ::$ expressions [$ expr ])) {
207
- $ expr = static ::$ expressions [$ expr ];
208
+ return static ::$ expressions [$ expr ];
208
209
}
209
210
210
- return $ expr ;
211
+ return \str_ireplace (
212
+ \array_keys (static ::$ literals ),
213
+ \array_values (static ::$ literals ),
214
+ $ expr
215
+ );
211
216
}
212
217
}
You can’t perform that action at this time.
0 commit comments