diff options
author | Brion Vibber <brion@pobox.com> | 2010-08-11 14:39:39 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-08-11 14:41:31 -0700 |
commit | 527561cd93b69ddaba660f272462aadfaef0c511 (patch) | |
tree | 28ee227bad7a05821182974c9f8b23b7848b5967 | |
parent | c19696afecd98f225181c8a8a368712954d6dbd4 (diff) |
TinyMCE: core tweak; switching order of input processing so length limit is applied to stripped version of the text
-rw-r--r-- | actions/newnotice.php | 14 | ||||
-rw-r--r-- | plugins/TinyMCE/TinyMCEPlugin.php | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/actions/newnotice.php b/actions/newnotice.php index 5e682ffd0..8263198f7 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -131,6 +131,8 @@ class NewnoticeAction extends Action $user = common_current_user(); assert($user); // XXX: maybe an error instead... $content = $this->trimmed('status_textarea'); + $options = array(); + Event::handle('StartSaveNewNoticeWeb', array($this, $user, &$content, &$options)); if (!$content) { $this->clientError(_('No content!')); @@ -157,11 +159,9 @@ class NewnoticeAction extends Action Notice::maxContent())); } - $replyto = $this->trimmed('inreplyto'); - #If an ID of 0 is wrongly passed here, it will cause a database error, - #so override it... - if ($replyto == 0) { - $replyto = 'false'; + $replyto = intval($this->trimmed('inreplyto')); + if ($replyto) { + $options['replyto'] = $replyto; } $upload = null; @@ -182,8 +182,6 @@ class NewnoticeAction extends Action } } - $options = array('reply_to' => ($replyto == 'false') ? null : $replyto); - if ($user->shareLocation()) { // use browser data if checked; otherwise profile data if ($this->arg('notice_data-geo')) { @@ -203,12 +201,12 @@ class NewnoticeAction extends Action $options = array_merge($options, $locOptions); } - Event::handle('SaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options)); $notice = Notice::saveNew($user->id, $content_shortened, 'web', $options); if (isset($upload)) { $upload->attachToNotice($notice); } + Event::handle('EndSaveNewNoticeWeb', array($this, $user, &$content_shortened, &$options)); if ($this->boolean('ajax')) { header('Content-Type: text/xml;charset=utf-8'); diff --git a/plugins/TinyMCE/TinyMCEPlugin.php b/plugins/TinyMCE/TinyMCEPlugin.php index 9408e20c9..d9e189375 100644 --- a/plugins/TinyMCE/TinyMCEPlugin.php +++ b/plugins/TinyMCE/TinyMCEPlugin.php @@ -115,7 +115,7 @@ class TinyMCEPlugin extends Plugin * @param array $options * @return boolean hook return */ - function onSaveNewNoticeWeb($action, $user, &$content, &$options) + function onStartSaveNewNoticeWeb($action, $user, &$content, &$options) { $html = $this->sanitizeHtml($action->arg('status_textarea')); $options['rendered'] = $html; |