function _shoutbox_sanitize_shout in Shoutbox 6
Same name and namespace in other branches
- 5 shoutbox.module \_shoutbox_sanitize_shout()
- 6.2 shoutbox.module \_shoutbox_sanitize_shout()
- 7.2 shoutbox.module \_shoutbox_sanitize_shout()
- 7 shoutbox.module \_shoutbox_sanitize_shout()
This function cleans the shout object before it is used.
Parameters
&$shout: The shout post object.
5 calls to _shoutbox_sanitize_shout()
- shoutbox_add_form_submit in ./
shoutbox.module - Handles submission of a shout. Handles both ajax submission and regular form submission.
- theme_shoutbox_delete_form in ./
shoutbox.pages.inc - Function to handle deleting of shouts.
- theme_shoutbox_publish_form in ./
shoutbox.pages.inc - Display a confirmation page for publsihing a moderated shout.
- theme_shoutbox_unpublish_form in ./
shoutbox.pages.inc - Function to handle moderation of shouts.
- _shoutbox_display_posts in ./
shoutbox.module - Output existing shoutbox posts as html. Used by shoutbox_get_view.
File
- ./
shoutbox.module, line 1020 - shoutbox module displays a block for users to create short messages for thw whole site. Uses AHAH to update the database and display content.
Code
function _shoutbox_sanitize_shout(&$shout) {
// All filtering (including urls, email addresses, censored words, and
// emoticons) is handled by the drupal filter system.
$shout->nick = check_plain($shout->nick);
$format = variable_get('shoutbox_filter_format', 'PLAIN');
if ($format == 'PLAIN') {
$shout->shout = check_plain($shout->shout);
}
else {
// ADD HUGE WARNING ABOUT DANGERS OF NOT FILTERING HTML
$shout->shout = check_markup($shout->shout, $format, FALSE);
}
$shout->url = check_url($shout->url);
$shout->color = check_plain($shout->color);
}