You are here

function _shoutbox_sanitize_shout in Shoutbox 5

Same name and namespace in other branches
  1. 6.2 shoutbox.module \_shoutbox_sanitize_shout()
  2. 6 shoutbox.module \_shoutbox_sanitize_shout()
  3. 7.2 shoutbox.module \_shoutbox_sanitize_shout()
  4. 7 shoutbox.module \_shoutbox_sanitize_shout()

This function cleans the shout object before it is used.

Parameters

&$shout: The shout post object.

3 calls to _shoutbox_sanitize_shout()
shoutbox_add_form_submit in ./shoutbox.module
Handles submission of a shout.
shoutbox_callback in ./shoutbox.module
Function to handle shoutbox callbacks that require a shout_id. Does some sanity checking on on the id before forwarding to the actual callback.
_shoutbox_display_posts in ./shoutbox.module
Output existing shoutbox posts as html. Used by shoutbox_block_view.

File

./shoutbox.module, line 1053
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);
}