You are here

function s in Quiz 6.5

Same name and namespace in other branches
  1. 6.6 includes/moodle_support.php \s()
4 calls to s()
qformat_default::error in includes/moodle/question/format.php
Handle parsing error
qformat_examview::parse_mc in includes/moodle/question/format/examview/format.php
qformat_examview::process_matches in includes/moodle/question/format/examview/format.php
qformat_examview::unxmlise in includes/moodle/question/format/examview/format.php
unxmlise reconstructs part of the xml data structure in order to identify the actual data therein

File

includes/moodle_support.php, line 241

Code

function s($var, $strip = false) {
  if ($var == '0') {

    // for integer 0, boolean false, string '0'
    return '0';
  }
  if ($strip) {
    return preg_replace("/&(#\\d+);/i", "&\$1;", htmlspecialchars(stripslashes_safe($var)));
  }
  else {
    return preg_replace("/&(#\\d+);/i", "&\$1;", htmlspecialchars($var));
  }
}