From 382b8b1351e1a4598f04ab184cec803b96d7e4b7 Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 31 Mar 2011 12:32:44 +0000 Subject: - Applied fixes from trunk --- program/include/rcmail.php | 12 +++++------- program/include/rcube_browser.php | 2 +- program/localization/index.inc | 4 ++-- program/steps/utils/spell_googie.inc | 2 ++ program/steps/utils/spell_html_googie.inc | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'program') diff --git a/program/include/rcmail.php b/program/include/rcmail.php index e1dc22d07..8b4383e10 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -1105,12 +1105,9 @@ class rcmail */ public function get_request_token() { - $key = $this->task; - - if (!$_SESSION['request_tokens'][$key]) - $_SESSION['request_tokens'][$key] = md5(uniqid($key . mt_rand(), true)); - - return $_SESSION['request_tokens'][$key]; + $sess_id = $_COOKIE[ini_get('session.name')]; + if (!$sess_id) $sess_id = session_id(); + return md5('RT' . $this->task . $this->config->get('des_key') . $sess_id); } @@ -1123,7 +1120,8 @@ class rcmail public function check_request($mode = RCUBE_INPUT_POST) { $token = get_input_value('_token', $mode); - return !empty($token) && $_SESSION['request_tokens'][$this->task] == $token; + $sess_id = $_COOKIE[ini_get('session.name')]; + return !empty($sess_id) && $token == $this->get_request_token(); } diff --git a/program/include/rcube_browser.php b/program/include/rcube_browser.php index d080c605d..d74ec708a 100644 --- a/program/include/rcube_browser.php +++ b/program/include/rcube_browser.php @@ -42,7 +42,7 @@ class rcube_browser $this->ns4 = strstr($HTTP_USER_AGENT, 'mozilla/4') && !strstr($HTTP_USER_AGENT, 'msie'); $this->ns = ($this->ns4 || strstr($HTTP_USER_AGENT, 'netscape')); $this->ie = !$this->opera && strstr($HTTP_USER_AGENT, 'compatible; msie'); - $this->mz = strstr($HTTP_USER_AGENT, 'mozilla/5'); + $this->mz = !$this->ie && strstr($HTTP_USER_AGENT, 'mozilla/5'); $this->chrome = strstr($HTTP_USER_AGENT, 'chrome'); $this->khtml = strstr($HTTP_USER_AGENT, 'khtml'); $this->safari = !$this->chrome && ($this->khtml || strstr($HTTP_USER_AGENT, 'safari')); diff --git a/program/localization/index.inc b/program/localization/index.inc index 5f33792ca..9925a87a5 100644 --- a/program/localization/index.inc +++ b/program/localization/index.inc @@ -42,8 +42,8 @@ $rcube_languages = array( 'cs_CZ' => 'Czech (Česky)', 'da_DK' => 'Danish (Dansk)', 'fa_AF' => 'Dari (ﻯﺭﺩ)', - 'de_DE' => 'Deutsch (Deutsch)', - 'de_CH' => 'Deutsch (Schweiz)', + 'de_DE' => 'German (Deutsch)', + 'de_CH' => 'German (Schweiz)', 'nl_NL' => 'Dutch (Nederlands)', 'en_GB' => 'English (GB)', 'en_US' => 'English (US)', diff --git a/program/steps/utils/spell_googie.inc b/program/steps/utils/spell_googie.inc index 4c98dd697..269d792dd 100644 --- a/program/steps/utils/spell_googie.inc +++ b/program/steps/utils/spell_googie.inc @@ -41,6 +41,8 @@ if (!empty($CONFIG['spellcheck_uri'])) } $data = file_get_contents('php://input'); +// Google has some problem with spaces, use \n instead +$data = str_replace(' ', "\n", $data); $store = ""; if ($fp = fsockopen($host, $port, $errno, $errstr, 30)) diff --git a/program/steps/utils/spell_html_googie.inc b/program/steps/utils/spell_html_googie.inc index 1a4fbd48d..df18c036b 100644 --- a/program/steps/utils/spell_html_googie.inc +++ b/program/steps/utils/spell_html_googie.inc @@ -80,7 +80,7 @@ if (!empty($CONFIG['spellcheck_uri'])) $path = $a_uri['path'] . ($a_uri['query'] ? '?'.$a_uri['query'] : '') . $lang; } -$wordstr = implode(' ', (array) $data); +$wordstr = implode("\n", (array) $data); $data = '' .'' .'' . $wordstr . '' -- cgit v1.2.3