Code Duplication    Length = 3-3 lines in 2 locations

main/inc/lib/internationalization.lib.php 2 locations

@@ 924-926 (lines=3) @@
921
function api_htmlentities($string, $quote_style = ENT_COMPAT, $encoding = 'UTF-8')
922
{
923
    switch ($quote_style) {
924
        case ENT_COMPAT:
925
            $string = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string);
926
            break;
927
        case ENT_QUOTES:
928
            $string = str_replace(array('&', '\'', '"', '<', '>'), array('&amp;', '&#039;', '&quot;', '&lt;', '&gt;'), $string);
929
            break;
@@ 927-929 (lines=3) @@
924
        case ENT_COMPAT:
925
            $string = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string);
926
            break;
927
        case ENT_QUOTES:
928
            $string = str_replace(array('&', '\'', '"', '<', '>'), array('&amp;', '&#039;', '&quot;', '&lt;', '&gt;'), $string);
929
            break;
930
    }
931
932
    return mb_convert_encoding($string, 'HTML-ENTITIES', 'UTF-8');