mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-30 21:30:14 +02:00
refactor: FeedItem::setTimestamp() (#3711)
This commit is contained in:
@@ -147,14 +147,16 @@ class FeedItem
|
||||
return $this->timestamp;
|
||||
}
|
||||
|
||||
public function setTimestamp($timestamp)
|
||||
public function setTimestamp($datetime)
|
||||
{
|
||||
$this->timestamp = null;
|
||||
if (
|
||||
!is_numeric($timestamp)
|
||||
&& !$timestamp = strtotime($timestamp)
|
||||
) {
|
||||
Debug::log('Unable to parse timestamp!');
|
||||
if (is_numeric($datetime)) {
|
||||
$timestamp = $datetime;
|
||||
} else {
|
||||
$timestamp = strtotime($datetime);
|
||||
if ($timestamp === false) {
|
||||
Debug::log('Unable to parse timestamp!');
|
||||
}
|
||||
}
|
||||
if ($timestamp <= 0) {
|
||||
Debug::log('Timestamp must be greater than zero!');
|
||||
|
Reference in New Issue
Block a user