diff --git a/vendor/PicoFeed/Parser.php b/vendor/PicoFeed/Parser.php index 8e8d89f..97c34e0 100644 --- a/vendor/PicoFeed/Parser.php +++ b/vendor/PicoFeed/Parser.php @@ -140,8 +140,16 @@ abstract class Parser $value = trim($value); 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();