You are here

function ad_text_display_prepare in Advertisement 5.2

Same name and namespace in other branches
  1. 5 text/ad_text.module \ad_text_display_prepare()
  2. 6.3 text/ad_text.module \ad_text_display_prepare()
  3. 6 text/ad_text.module \ad_text_display_prepare()
  4. 6.2 text/ad_text.module \ad_text_display_prepare()
  5. 7 text/ad_text.module \ad_text_display_prepare()

Strip illegal characters, encode the rest UTF-8.

2 calls to ad_text_display_prepare()
ad_text_adapi in text/ad_text.module
ad_text_display_ad in text/ad_text.module
Function used to display the selected ad.

File

text/ad_text.module, line 25
Enhances the ad module to support static text ads.

Code

function ad_text_display_prepare($string, $format = FALSE) {
  $string = preg_replace("/[\\b\f\n\r\t]/", ' ', $string);
  $string = htmlentities($string, ENT_QUOTES, 'UTF-8');
  if ($format !== FALSE && variable_get('ad_filter', 0)) {
    $string = check_markup($string, $format, FALSE);
  }
  return $string;
}