Aleksander Machniak
2014-11-27 32eb977b1268ce1e32ab652af6059f49ce59c2f5
program/lib/Roundcube/rcube_utils.php
@@ -103,13 +103,14 @@
            }
            foreach ($domain_array as $part) {
                if (!preg_match('/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]))$/', $part)) {
                if (!preg_match('/^((xn--)?([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]))$/', $part)) {
                    return false;
                }
            }
            // last domain part
            if (preg_match('/[^a-zA-Z]/', array_pop($domain_array))) {
            $last_part = array_pop($domain_array);
            if (strpos($last_part, 'xn--') !== 0 && preg_match('/[^a-zA-Z]/', $last_part)) {
                return false;
            }
@@ -796,7 +797,7 @@
        // try to parse string with DateTime first
        if (!empty($date)) {
            try {
                $dt = new DateTime($date, $timezone);
                $dt = $timezone ? new DateTime($date, $timezone) : new DateTime($date);
            }
            catch (Exception $e) {
                // ignore
@@ -1068,7 +1069,7 @@
            return (bool) preg_match('!^[a-z]:[\\\\/]!i', $path);
        }
        else {
            return $path[0] == DIRECTORY_SEPARATOR;
            return $path[0] == '/';
        }
    }