Skip to content

Commit

Permalink
Merge pull request #1429 from nextcloud/backport/1298/stable26
Browse files Browse the repository at this point in the history
[stable26] fix incorrect Date format detection
  • Loading branch information
solracsf authored Nov 13, 2023
2 parents d5ac288 + e45b3c3 commit 8b4e8b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Model/Circle.php
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,9 @@ public function importFromDatabase(array $data, string $prefix = ''): IQueryRow
->setDescription($this->get($prefix . 'description', $data));

$creation = $this->get($prefix . 'creation', $data);
$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
$dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation);
$timestamp = $dateTime ? $dateTime->getTimestamp() : (int) strtotime($creation);
$this->setCreation($timestamp);

$this->setPopulation($this->getInt('population', $this->getSettings()));
$this->setPopulationInherited($this->getInt('populationInherited', $this->getSettings()));
Expand Down

0 comments on commit 8b4e8b2

Please sign in to comment.