Aleksander Machniak
2015-09-13 cffe97eb6ede164d8169dda4e8922baea3dda0e1
program/include/rcmail.php
@@ -178,9 +178,11 @@
        // set localization
        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 (PHP_VERSION_ID < 50500 && in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
            setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8');
        // Workaround for http://bugs.php.net/bug.php?id=18556
        // Also strtoupper/strtolower and other methods are locale-aware
        // for these locales it is problematic (#1490519)
        if (in_array($lang, array('tr_TR', 'ku', 'az_AZ'))) {
            setlocale(LC_CTYPE, 'en_US.utf8', 'en_US.UTF-8', 'C');
        }
    }
@@ -808,7 +810,7 @@
            // remove old token from the path
            $base_path = rtrim($base_path, '/');
            $base_path = preg_replace('/\/[a-f0-9]{' . strlen($token) . '}$/', '', $base_path);
            $base_path = preg_replace('/\/[a-zA-Z0-9]{' . strlen($token) . '}$/', '', $base_path);
            // this need to be full url to make redirects work
            $absolute = true;
@@ -2305,7 +2307,7 @@
     *
     * @return string Plain text
     */
    public function html2text($html, $options)
    public function html2text($html, $options = array())
    {
        $default_options = array(
            'links'   => true,
@@ -2314,7 +2316,7 @@
            'charset' => RCUBE_CHARSET,
        );
        $options = array_merge($default_options, $options);
        $options = array_merge($default_options, (array) $options);
        // Plugins may want to modify HTML in another/additional way
        $options = $this->plugins->exec_hook('html2text', $options);