Aleksander Machniak
2014-08-24 75bbada03b0e616248ec3458d1a6ee98bfc03659
Remove code for PHP<5.3, use PHP_VERSION_ID instead of version_compare() for version checks
3 files modified
15 ■■■■ changed files
program/include/rcmail.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_utils.php 11 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_washtml.php 2 ●●● patch | view | raw | blame | history
program/include/rcmail.php
@@ -173,7 +173,7 @@
        setlocale(LC_ALL, $lang . '.utf8', $lang . '.UTF-8', 'en_US.utf8', 'en_US.UTF-8');
        // workaround for http://bugs.php.net/bug.php?id=18556
        if (version_compare(PHP_VERSION, '5.5.0', '<') && in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
        if (PHP_VERSION_ID < 50500 && in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
            setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8');
        }
    }
program/lib/Roundcube/rcube_utils.php
@@ -119,17 +119,6 @@
                return true;
            }
            if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && version_compare(PHP_VERSION, '5.3.0', '<')) {
                $lookup = array();
                @exec("nslookup -type=MX " . escapeshellarg($domain_part) . " 2>&1", $lookup);
                foreach ($lookup as $line) {
                    if (strpos($line, 'MX preference')) {
                        return true;
                    }
                }
                return false;
            }
            // find MX record(s)
            if (!function_exists('getmxrr') || getmxrr($domain_part, $mx_records)) {
                return true;
program/lib/Roundcube/rcube_washtml.php
@@ -378,7 +378,7 @@
        $this->max_nesting_level = (int) @ini_get('xdebug.max_nesting_level');
        // Use optimizations if supported
        if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
        if (PHP_VERSION_ID >= 50400) {
            @$node->loadHTML($html, LIBXML_PARSEHUGE | LIBXML_COMPACT);
        }
        else {