From db43195fbf29c16d68e1ce43cb316949b1c1f4ea Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 28 Dec 2010 23:36:25 +0000 Subject: [PATCH] fixup date handling in showbookmark for PHP 5.2 --- plugins/Bookmark/showbookmark.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/Bookmark/showbookmark.php b/plugins/Bookmark/showbookmark.php index 07dec5a98c..54f333fd52 100644 --- a/plugins/Bookmark/showbookmark.php +++ b/plugins/Bookmark/showbookmark.php @@ -81,9 +81,8 @@ class ShowbookmarkAction extends ShownoticeAction throw new ClientException(_('No such URL.'), 404); } - $dt = DateTime::createFromFormat('YmdHis', - $this->trimmed('created'), - new DateTimeZone('UTC')); + $dt = new DateTime($this->trimmed('created'), + new DateTimeZone('UTC')); if (empty($dt)) { throw new ClientException(_('No such create date.'), 404); @@ -92,9 +91,9 @@ class ShowbookmarkAction extends ShownoticeAction $bookmarks = Bookmark::getByCRC32($this->profile, $crc32); - foreach ($bookmarks as $bookmark) { + foreach ($bookmarks as $bookmark) { $bdt = new DateTime($bookmark->created, new DateTimeZone('UTC')); - if ($bdt->getTimestamp() == $dt->getTimestamp()) { + if ($bdt->format('U') == $dt->format('U')) { $this->bookmark = $bookmark; break; } -- 2.39.5