Subversion Repositories PHPX

Compare Revisions

Last modification

Ignore whitespace Rev 21 → Rev 22

/trunk/global.inc
223,6 → 223,31
}
 
/**
* Converts HTML entities to real characters using the detected
* or specified character encoding.
*
* @param string $s
* @param int[optional] $quote_style
* @return string
*/
function htmlEntityDecode($s, $quote_style=ENT_COMPAT, $encoding=null)
{
$s = (string) $s;
if (is_null($encoding))
{
$encoding = mb_detect_encoding($s);
if ($encoding === 'ASCII')
{
$encoding = 'ISO-8859-1';
}
}
return html_entity_decode($s, $quote_style, $encoding);
}
 
 
/**
* Converts the argument into a visible (X)HTML hyperlink if a condition
* applies.
*