From ea1676cb0acfe70858f041ac133d3240f2827597 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 26 Dec 2010 21:10:23 -0800 Subject: [PATCH] UTC only and tighter date format for showbookmark --- plugins/Bookmark/showbookmark.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Bookmark/showbookmark.php b/plugins/Bookmark/showbookmark.php index f6213ef5db..a547de09f0 100644 --- a/plugins/Bookmark/showbookmark.php +++ b/plugins/Bookmark/showbookmark.php @@ -75,13 +75,13 @@ class ShowbookmarkAction extends ShownoticeAction $this->avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE); - $crc32 = pack("H*", $this->trimmed('crc32')); + sscanf($this->trimmed('crc32'), '%08x', $crc32); if (empty($crc32)) { throw new ClientException(_('No such URL.'), 404); } - $dt = DateTime::createFromFormat(DateTime::W3C, + $dt = DateTime::createFromFormat('YmdHis', $this->trimmed('created'), new DateTimeZone('UTC')); @@ -90,10 +90,10 @@ class ShowbookmarkAction extends ShownoticeAction } $bookmarks = Bookmark::getByCRC32($this->profile, - $this->crc32); + $crc32); foreach ($bookmarks as $bookmark) { - $bdt = new DateTime($bookmark->created); + $bdt = new DateTime($bookmark->created, new DateTimeZone('UTC')); if ($bdt->getTimestamp() == $dt->getTimestamp()) { $this->bookmark = $bookmark; break; -- 2.39.5