]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fixup date handling in showbookmark for PHP 5.2
authorEvan Prodromou <evan@status.net>
Tue, 28 Dec 2010 23:36:25 +0000 (23:36 +0000)
committerEvan Prodromou <evan@status.net>
Tue, 28 Dec 2010 23:36:25 +0000 (23:36 +0000)
plugins/Bookmark/showbookmark.php

index 07dec5a98cd99bfd2e1927906b2c2bbee4788147..54f333fd5227be6cff27895deddee18772af0384 100644 (file)
@@ -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;
             }