6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
7/18/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#4609] Wrong timezone used in linked attachment notifications
*
Your Email Address
*
Spam protection
Enter the letters below:
__..___.. .. ..___ (__ | |\/||__|[__ .__) | | || |[___
Comment
> In link attachment downloaded notifications emails, the "Attachment > Date:" is set to GMT-10 instead of GMT-5 on our system in the EST > timezone. Using a real example, when the receipient of the link > attachment downloaded the attachment, the sender received the link > attachment download notification email with: > > > > Attachment date: Wed, 1 Nov 2006 03:37:12 -0500 > > > > when the correct time the attachment was uploaded was actually: > > > > Wed, 1 Nov 2006 08:37:12 -0500. > > > > The problem appears to be caused by the use of gmmktime in > horde/imp/lib/Compose.php. It uses: > > > > $ts = gmmktime(); > > $fullpath = sprintf('%s/%s/%d', IMP_VFS_LINK_ATTACH_PATH, $auth, $ts); > > > > So this generates a URL in email sent to the receipient like so: > > > > https://server/attachment.php?u=<email>&t=<gmmktime()>&f=<attachment> > > > > horde/imp/attachment.php then uses the value of t=<gmmktime()> as the date: > > > > time_stamp = Util::getFormData('t'); > > [snip] > > $msg->setContents(String::wrap(sprintf(_("Your linked attachment has > been downloaded by at least one user.\n\nAttachment name: %s\nAtt > > achment date: %s\n\nClick on the following link to permanently delete > the attachment:\n%s"), $file_name, date('r', $time_stamp), > Util::addParamete > > r(Horde::selfUrl(true, false, true), 'd', $id)))); > > > > On my system, gmmktime() returns seconds since epoch + 5 hours and > time() returns second since epoch. So I used this patch: > > > > [root@puma imp]# diff attachment.php attachment.php.orig > > 47,49d46 > > < // generate timestamp that shows correct timezone for notification email > > < $time_stamp_display = $time_stamp - intval(date('Z', $time_stamp)); > > < > > 113c110 > > < $msg->setContents(String::wrap(sprintf(_("Your linked > attachment has been downloaded by at least one user.\n\nAttachment > name: %s\nAttachment date: %s\n\nClick on the following link to > permanently delete the attachment:\n%s"), $file_name, date('r', > $time_stamp_display), Util::addParameter(Horde::selfUrl(true, false, > true), 'd', $id)))); > > --- > >> $msg->setContents(String::wrap(sprintf(_("Your linked >> attachment has been downloaded by at least one user.\n\nAttachment >> name: %s\nAttachment date: %s\n\nClick on the following link to >> permanently delete the attachment:\n%s"), $file_name, date('r', >> $time_stamp), Util::addParameter(Horde::selfUrl(true, false, true), >> 'd', $id)))); > > > > I'm using Horde 3.1.4, IMP 4.1.3 on RHEL 4 AS U4. This has PHP > version 4.3.9. > >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers