oEdit and PHP 5.4

Questions about how to use the online - editors and suggestions how to improve them
Post Reply
cmb
Posts: 13768
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

oEdit and PHP 5.4

Post by cmb » Sun Oct 07, 2012 6:46 pm

Hello Community,

I've noticed that the default images of the editor buttons don't work under PHP 5.4. That's caused by the function hex2bin(), that is defined in cmsimple/images.php (as it was missing from PHP), but finally was introduced in PHP 5.4. This can be fixed by replacing line 18-24 with:

Code: Select all

if (!function_exists('hex2bin')) {
    function hex2bin($s) {
        $bin = '';
        for($i = 0; $i < strlen($s); $i += 2) {
            $bin .= chr(hexdec(substr($s, $i, 2)));
        }
        return $bin;
    }
} 
Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply