You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #58791 [RateLimiter] handle error results of DateTime::modify() (xabbuh)
This PR was merged into the 5.4 branch.
Discussion
----------
[RateLimiter] handle error results of DateTime::modify()
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues |
| License | MIT
Depending on the version of PHP the `modify()` method will either throw an exception or issue a warning.
Commits
-------
fb6549d handle error results of DateTime::modify()
thrownew \LogicException(\sprintf('Cannot parse interval "%s", please use a valid unit as described on https://www.php.net/datetime.formats.relative.', $interval), 0, $e);
79
+
}
81
80
82
-
thrownew \LogicException(sprintf('Cannot parse interval "%s", please use a valid unit as described on https://www.php.net/datetime.formats.relative.', $m[1]));
81
+
if (!$nowPlusInterval) {
82
+
thrownew \LogicException(\sprintf('Cannot parse interval "%s", please use a valid unit as described on https://www.php.net/datetime.formats.relative.', $interval));
0 commit comments