예제 #1
0
파일: global.php 프로젝트: jprice/EHCP
 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;
 }
예제 #2
0
 /**
  * Creates info block
  * @return string html formated output
  */
 function createWidget_Info()
 {
     return sq_htmlspecialchars($this->value);
 }