[php-src] Issue #12393: strtotime not returning false for the wrong string
| From: | asmafarhat2006 | Date: | Mon, 09 Oct 2023 12:50:39 +0000 |
| Subject: | [php-src] Issue #12393: strtotime not returning false for the wrong string | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245524@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12393
Author: asmafarhat2006
### Description
The following code:
```php
<?php
$trimmed = 'MONDAY 2, Tuesday 2, Wednesday 3, Thursday 4, Friday 5';
var_dump(strtotime($trimmed));
$trimmed = 'Monday ,Tuesday , Wednesday';
var_dump(strtotime($trimmed));
```
For first var_dump returns false which is correct but for second var_dump returns the UNIX timestamp
which is incorrect
It should return false when there are multiple days in week. which it does for the first example but
doesnt for the 2nd.
Affects all PHP versions 7.4+
### PHP Version
PHP 7.4+
### Operating System
_No response_