Fix updatePublishedAt on already parsed article's date

This commit is contained in:
Simounet
2017-07-19 20:16:23 +02:00
committed by Jeremy Benoist
parent ea127a401b
commit b236d3f627

View File

@ -122,7 +122,7 @@ class ContentProxy
*/ */
public function updatePublishedAt(Entry $entry, $value) public function updatePublishedAt(Entry $entry, $value)
{ {
$date = $value; $date = $value instanceof \DateTime ? $value->date : $value;
// is it a timestamp? // is it a timestamp?
if (filter_var($date, FILTER_VALIDATE_INT) !== false) { if (filter_var($date, FILTER_VALIDATE_INT) !== false) {