Skip to content

Commit

Permalink
Allow plugins to override message compose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascube committed Nov 14, 2013
1 parent 38c9df8 commit e957bfe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion program/steps/mail/compose.inc
Expand Up @@ -646,7 +646,7 @@ function rcmail_prepare_message_body()
}
else if ($COMPOSE['param']['body']) {
$body = $COMPOSE['param']['body'];
$isHtml = false;
$isHtml = (bool) $COMPOSE['param']['html'];

This comment has been minimized.

Copy link
@alecpl

alecpl Nov 14, 2013

Member

Well, I suppose this does not change editor settings, so if editor is disabled but 'html' param enabled user will still see plain text editor. Second, I'm not sure, but I think we should clean up HTML content for security, as these params might be provided in URL.

}
// forward as attachment
else if ($compose_mode == RCUBE_COMPOSE_FORWARD && $COMPOSE['as_attachment']) {
Expand Down

3 comments on commit e957bfe

@thomascube
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that doesn't enable the editor the yet existing plugin hook for 'message_compose_body' doesn't do it either which is a bug.
And yes, cleaning HTML would be required here. I think best is to do that right after rcube_utils::request2param() in compose.inc

@thomascube
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, it actually should change editor settings because further down in that function we have $HTML_MODE = $isHtml; which controls the HTML editor.

@thomascube
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 2af3748

Please sign in to comment.