Bug fix date parsing (thanks to @skasi7)
This commit is contained in:
parent
d92f201fdc
commit
61b12ab4d7
12
vendor/PicoFeed/Parser.php
vendored
12
vendor/PicoFeed/Parser.php
vendored
@ -140,8 +140,16 @@ abstract class Parser
|
|||||||
$value = trim($value);
|
$value = trim($value);
|
||||||
|
|
||||||
foreach ($formats as $format => $length) {
|
foreach ($formats as $format => $length) {
|
||||||
$timestamp = $this->getValidDate($format, substr($value, 0, $length));
|
|
||||||
if ($timestamp > 0) return $timestamp;
|
$truncated_value = $value;
|
||||||
|
if ($length !== null) {
|
||||||
|
$truncated_value = substr($truncated_value, 0, $length);
|
||||||
|
}
|
||||||
|
|
||||||
|
$timestamp = $this->getValidDate($format, $truncated_value);
|
||||||
|
if ($timestamp > 0) {
|
||||||
|
return $timestamp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return time();
|
return time();
|
||||||
|
Loading…
Reference in New Issue
Block a user