cvs: pearweb /include/notes ManualNotes.class.php
| From: | Greg Beaver | Date: | Fri, 23 Mar 2007 16:40:25 +0000 |
| Subject: | cvs: pearweb /include/notes ManualNotes.class.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-45380@lists.php.net to get a copy of this message | ||
cellog Fri Mar 23 16:40:25 2007 UTC
Modified files:
/pearweb/include/notes ManualNotes.class.php
Log:
fix Bug #10470 timestamp is displayed as 1969 for all notes
http://cvs.php.net/viewvc.cgi/pearweb/include/notes/ManualNotes.class.php?r1=1.13&r2=1.14&diff_format=u
Index: pearweb/include/notes/ManualNotes.class.php
diff -u pearweb/include/notes/ManualNotes.class.php:1.13
pearweb/include/notes/ManualNotes.class.php:1.14
--- pearweb/include/notes/ManualNotes.class.php:1.13 Fri Mar 23 16:31:23 2007
+++ pearweb/include/notes/ManualNotes.class.php Fri Mar 23 16:40:25 2007
@@ -395,7 +395,13 @@
function display($comment)
{
- $time = date('d-M-Y H:i', strtotime($comment['note_time']));
+ // MySQL 4.1 displays timestamps as if they were datetimes, so make
+ // sure this doesn't break on upgrade
+ if (is_numeric($comment['note_time'])) {
+ $time = date('d-M-Y H:i', $comment['note_time']);
+ } else {
+ $time = date('d-M-Y H:i', strtotime($comment['note_time']));
+ }
$noteId = (int)$comment['note_id'];
$userHandle = $comment['user_handle'] ?
'<a href="/user/' . $comment['user_handle'] .
'">' . $comment['user_handle'] .