XH 1.5.4 produces blank screen after login

A place to report and discuss bugs - please mention CMSimple-version, server, platform and browser version
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

XH 1.5.4 produces blank screen after login

Post by cmb » Tue Oct 09, 2012 10:18 pm

Hello Community,

I've just found, that CMSimple_XH 1.5.4 produces a blank screen after login, if the mb_string extension is <INS>not</INS> available.

This bug can be fixed by changing function utf8_from_unicode in plugins/utf8/utils/unicode.php to:

Code: Select all

function utf8_from_unicode($arr) {
    $o = '';
    
    foreach (array_keys($arr) as $k) {
        
        # ASCII range (including control chars)
        if ( ($arr[$k] >= 0) && ($arr[$k] <= 0x007f) ) {
            
            $o .= chr($arr[$k]);
        
        # 2 byte sequence
        } else if ($arr[$k] <= 0x07ff) {
            
            $o .= chr(0xc0 | ($arr[$k] >> 6));
            $o .= chr(0x80 | ($arr[$k] & 0x003f));
        
        # Byte order mark (skip)
        } else if($arr[$k] == 0xFEFF) {
            
            // nop -- zap the BOM
        
        # Test for illegal surrogates
        } else if ($arr[$k] >= 0xD800 && $arr[$k] <= 0xDFFF) {
            
            // found a surrogate
            trigger_error(
                'utf8_from_unicode: Illegal surrogate '.
                    'at index: '.$k.', value: '.$arr[$k],
                E_USER_WARNING
                );
            
            return FALSE;
        
        # 3 byte sequence
        } else if ($arr[$k] <= 0xffff) {
            
            $o .= chr(0xe0 | ($arr[$k] >> 12));
            $o .= chr(0x80 | (($arr[$k] >> 6) & 0x003f));
            $o .= chr(0x80 | ($arr[$k] & 0x003f));
        
        # 4 byte sequence
        } else if ($arr[$k] <= 0x10ffff) {
            
            $o .= chr(0xf0 | ($arr[$k] >> 18));
            $o .= chr(0x80 | (($arr[$k] >> 12) & 0x3f));
            $o .= chr(0x80 | (($arr[$k] >> 6) & 0x3f));
            $o .= chr(0x80 | ($arr[$k] & 0x3f));
            
        } else {
            
            trigger_error(
                'utf8_from_unicode: Codepoint out of Unicode range '.
                    'at index: '.$k.', value: '.$arr[$k],
                E_USER_WARNING
                );
            
            // out of range
            return FALSE;
        }
    }
    
    return $o;
} 
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply