From 64925a275e8393a234183e0b97c0711ed56876a6 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 4 Mar 2011 15:26:25 -0500 Subject: [PATCH 1/4] format Atom datetimes as UTC --- lib/activity.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/activity.php b/lib/activity.php index b781e49846..837be94ece 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -708,7 +708,6 @@ class Activity { $dateStr = date('d F Y H:i:s', $tm); $d = new DateTime($dateStr, new DateTimeZone('UTC')); - $d->setTimezone(new DateTimeZone(common_timezone())); return $d->format('c'); } } From 1d7f54ee386c667e3d373bb7dd1dbed31d996391 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 10 Mar 2011 18:08:14 +0000 Subject: [PATCH 2/4] Show a reasonable error message when an image is bad, instead of letting the exception continue bubbling up. --- actions/newapplication.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/actions/newapplication.php b/actions/newapplication.php index eb13593536..657c7bcb71 100644 --- a/actions/newapplication.php +++ b/actions/newapplication.php @@ -22,7 +22,7 @@ * @category Applications * @package StatusNet * @author Zach Copley - * @copyright 2008-2009 StatusNet, Inc. + * @copyright 2008-2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ @@ -290,7 +290,13 @@ class NewApplicationAction extends OwnerDesignAction $app->query('ROLLBACK'); } - $app->uploadLogo(); + try { + $app->uploadLogo(); + } catch (Exception $e) { + $app->query('ROLLBACK'); + $this->showForm(_('Invalid image.')); + return; + } $app->query('COMMIT'); From a4305401557f56656d98e1bb22dd68e83a5622c7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 17 Mar 2011 11:31:43 -0400 Subject: [PATCH 3/4] configuration option to bust frames or not --- README | 3 +++ lib/action.php | 4 +++- lib/default.php | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README b/README index c27182395c..58ebd290b0 100644 --- a/README +++ b/README @@ -1139,6 +1139,9 @@ ssl: Whether to use SSL for JavaScript files. Default is null, which means sslserver: SSL server to use when page is HTTPS-encrypted. If unspecified, site ssl server and so on will be used. sslpath: If sslserver if defined, path to use when page is HTTPS-encrypted. +bustframes: If true, all web pages will break out of framesets. If false, + can comfortably live in a frame or iframe... probably. Default + to true. xmpp ---- diff --git a/lib/action.php b/lib/action.php index 173e2c2a58..fef4259264 100644 --- a/lib/action.php +++ b/lib/action.php @@ -298,7 +298,9 @@ class Action extends HTMLOutputter // lawsuit $this->script('util.min.js'); $this->showScriptMessages(); // Frame-busting code to avoid clickjacking attacks. - $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); + if (common_config('javascript', 'bustframes')) { + $this->inlineScript('if (window.top !== window.self) { window.top.location.href = window.self.location.href; }'); + } Event::handle('EndShowStatusNetScripts', array($this)); Event::handle('EndShowLaconicaScripts', array($this)); } diff --git a/lib/default.php b/lib/default.php index 124c90c998..c1dfcbc87d 100644 --- a/lib/default.php +++ b/lib/default.php @@ -154,7 +154,8 @@ $default = 'javascript' => array('server' => null, 'path'=> null, - 'ssl' => null), + 'ssl' => null, + 'bustframes' => true), 'local' => // To override path/server for themes in 'local' dir (not currently applied to local plugins) array('server' => null, 'dir' => null, From df4afee86ce847e26f76a075c8f676ca56c736fa Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 18 Mar 2011 13:58:13 -0700 Subject: [PATCH 4/4] Tickets #1610, #1949: show permalinks on Popular Notices, attachments aside sections These mini notice lists were previously not actually showing links to the notices, making them hard to use. There was code to output a link, but it had been unused due to the config options triggering it not being set. The links also looked bad ("( see )" with bad spacing). Replaced that code with a call into NoticeListItem's existing code to format a relative timestamp with the notice permalink, which looks nice. Used a div rather than p to avoid clearing the float, so it flows nicely. --- lib/noticesection.php | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/lib/noticesection.php b/lib/noticesection.php index 7157feafc5..ceb0bb36f8 100644 --- a/lib/noticesection.php +++ b/lib/noticesection.php @@ -39,6 +39,8 @@ define('NOTICES_PER_SECTION', 6); * These are the widgets that show interesting data about a person * group, or site. * + * @todo migrate this to use a variant of NoticeList + * * @category Widget * @package StatusNet * @author Evan Prodromou @@ -97,38 +99,14 @@ class NoticeSection extends Section $this->out->elementStart('p', 'entry-content'); $this->out->raw($notice->rendered); - - $notice_link_cfg = common_config('site', 'notice_link'); - if ('direct' === $notice_link_cfg) { - $this->out->text(' ('); - $this->out->element('a', array('href' => $notice->uri), 'see'); - $this->out->text(')'); - } elseif ('attachment' === $notice_link_cfg) { - if ($count = $notice->hasAttachments()) { - // link to attachment(s) pages - if (1 === $count) { - $f2p = File_to_post::staticGet('post_id', $notice->id); - $href = common_local_url('attachment', array('attachment' => $f2p->file_id)); - $att_class = 'attachment'; - } else { - $href = common_local_url('attachments', array('notice' => $notice->id)); - $att_class = 'attachments'; - } - - $clip = Theme::path('images/icons/clip.png', 'base'); - $this->out->elementStart('a', array('class' => $att_class, 'style' => "font-style: italic;", 'href' => $href, 'title' => "# of attachments: $count")); - $this->out->raw(" ($count "); - $this->out->element('img', array('style' => 'display: inline', 'align' => 'top', 'width' => 20, 'height' => 20, 'src' => $clip, 'alt' => 'alt')); - $this->out->text(')'); - $this->out->elementEnd('a'); - } else { - $this->out->text(' ('); - $this->out->element('a', array('href' => $notice->uri), 'see'); - $this->out->text(')'); - } - } - $this->out->elementEnd('p'); + + $this->out->elementStart('div', 'entry_content'); + get_class('NoticeList'); + $nli = new NoticeListItem($notice, $this->out); + $nli->showNoticeLink(); + $this->out->elementEnd('div'); + if (!empty($notice->value)) { $this->out->elementStart('p'); $this->out->text($notice->value);