You are here

function lightbox2_filter_xss in Lightbox2 5.2

Same name and namespace in other branches
  1. 8 lightbox2.module \lightbox2_filter_xss()
  2. 6 lightbox2.module \lightbox2_filter_xss()
  3. 7.2 lightbox2.module \lightbox2_filter_xss()
  4. 7 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 2436
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);
  }
  lightbox2_drupal_json($output);
}