Example #1
0
 function acaHtmlEntityDecode($string, $quote_style = ENT_COMPAT, $charset = null)
 {
     if (is_null($charset)) {
         $charset = acajoom_mail::acaGetCharset();
     }
     if (function_exists('html_entity_decode')) {
         return @html_entity_decode($string, $quote_style, $charset);
     }
     if (!is_int($quote_style) && !is_null($quote_style)) {
         user_error(__FUNCTION__ . '() expects parameter 2 to be long, ' . gettype($quote_style) . ' given', 'warning');
         return;
     }
     $trans_tbl = get_html_translation_table(HTML_ENTITIES);
     $trans_tbl = array_flip($trans_tbl);
     $trans_tbl['''] = '\'';
     if ($quote_style & ENT_NOQUOTES) {
         unset($trans_tbl['"']);
     }
     return strtr($string, $trans_tbl);
 }