function sq_htmlspecialchars($value, $quote_style = ENT_QUOTES) { if ($quote_style === FALSE) { $quote_style = ENT_QUOTES; } // array? go recursive... // if (is_array($value)) { $return_array = array(); foreach ($value as $key => $val) { $return_array[sq_htmlspecialchars($key, $quote_style)] = sq_htmlspecialchars($val, $quote_style); } return $return_array; // sanitize strings only // } else { if (is_string($value)) { if ($quote_style === TRUE) { return str_replace(array('\'', '"'), array(''', '"'), $value); } else { return htmlspecialchars($value, $quote_style); } } } // anything else gets returned with no changes // return $value; }
/** * Creates info block * @return string html formated output */ function createWidget_Info() { return sq_htmlspecialchars($this->value); }