Example #1
0
function ConvertToXmlAttribute($value)
{
    if (IS_WINDOWS_OS || FindBadUtf8($value)) {
        return api_utf8_encode(htmlspecialchars($value));
    } else {
        return htmlspecialchars($value);
    }
}
Example #2
0
function ConvertToXmlAttribute($value)
{
    if (defined('PHP_OS')) {
        $os = PHP_OS;
    } else {
        $os = php_uname();
    }
    if (strtoupper(substr($os, 0, 3)) === 'WIN' || FindBadUtf8($value)) {
        return utf8_encode(htmlspecialchars($value));
    } else {
        return htmlspecialchars($value);
    }
}
Example #3
0
function ConvertToXmlAttribute($value)
{
    if (defined('PHP_OS')) {
        $os = PHP_OS;
    } else {
        $os = php_uname();
    }
    if (strtoupper(substr($os, 0, 3)) === 'WIN' || FindBadUtf8($value)) {
        return utf8_encode(htmlentities($value, ENT_QUOTES, "UTF-8"));
    } else {
        return htmlentities($value, ENT_QUOTES, "UTF-8");
    }
}
Example #4
0
function ConvertToXmlAttribute($value)
{
    // util_debug($value);
    // util_debug( utf8_encode( htmlspecialchars( $value ) ));
    if (defined('PHP_OS')) {
        $os = PHP_OS;
    } else {
        $os = php_uname();
    }
    if (strtoupper(substr($os, 0, 3)) === 'WIN' || FindBadUtf8($value)) {
        //	        util_debug('FindBad' .  htmlspecialchars($value));
        //               util_debug('FindBad' . utf8_encode( htmlspecialchars( $value ) ));
        return utf8_encode(htmlspecialchars($value));
    } else {
        //	util_debug('speccial chars=' . htmlspecialchars($value));
        return htmlspecialchars($value);
    }
}