You are here

function lightbox2_filter_xss in Lightbox2 7

Same name and namespace in other branches
  1. 8 lightbox2.module \lightbox2_filter_xss()
  2. 5.2 lightbox2.module \lightbox2_filter_xss()
  3. 6 lightbox2.module \lightbox2_filter_xss()
  4. 7.2 lightbox2.module \lightbox2_filter_xss()
1 string reference to 'lightbox2_filter_xss'
lightbox2_menu in ./lightbox2.module
Implementation of hook_menu().

File

./lightbox2.module, line 1650
Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.

Code

function lightbox2_filter_xss() {
  $allowed_tags = trim(variable_get('lightbox2_filter_xss_allowed_tags', 'p, br, a, em, strong, cite, code, ul, ol, li, dl, dt, dd, '));
  $allowed_tags = empty($allowed_tags) ? array() : preg_split('/[,\\s]+/', $allowed_tags);
  if (!empty($_POST['allowed_tags']) && $_POST['allowed_tags'] != 'undefined') {
    $allowed_tags = explode(',', $_POST['allowed_tags']);
    $output = filter_xss($_POST['string'], $allowed_tags);
  }
  else {
    $output = filter_xss($_POST['string'], $allowed_tags);
  }
  drupal_json_output($output);
}