summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-27 08:43:43 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-27 08:43:43 +0100
commita92beb6bdb9cb857e8cee6606033691f11692230 (patch)
tree4733c82a5989817bb7d61b0ad9bd12cb62a2b881 /program/lib/Roundcube
parent581fe08a050bea2dbdcad30b9a0ea02f5623a3ac (diff)
Define RCUBE_CHARSET in place of RCMAIL_CHARSET for naming consistency
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/bootstrap.php6
-rw-r--r--program/lib/Roundcube/html.php2
-rw-r--r--program/lib/Roundcube/rcube.php2
-rw-r--r--program/lib/Roundcube/rcube_charset.php4
-rw-r--r--program/lib/Roundcube/rcube_config.php4
-rw-r--r--program/lib/Roundcube/rcube_contacts.php4
-rw-r--r--program/lib/Roundcube/rcube_csv2vcard.php2
-rw-r--r--program/lib/Roundcube/rcube_mime.php10
-rw-r--r--program/lib/Roundcube/rcube_output.php2
-rw-r--r--program/lib/Roundcube/rcube_output_html.php4
-rw-r--r--program/lib/Roundcube/rcube_spellchecker.php10
-rw-r--r--program/lib/Roundcube/rcube_vcard.php10
12 files changed, 31 insertions, 29 deletions
diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php
index 47020c1ab..eed7db8c1 100644
--- a/program/lib/Roundcube/bootstrap.php
+++ b/program/lib/Roundcube/bootstrap.php
@@ -49,7 +49,7 @@ foreach ($config as $optname => $optval) {
// framework constants
define('RCUBE_VERSION', '0.9-git');
-define('RCMAIL_CHARSET', 'UTF-8');
+define('RCUBE_CHARSET', 'UTF-8');
if (!defined('RCUBE_LIB_DIR')) {
define('RCUBE_LIB_DIR', dirname(__FILE__).'/');
@@ -73,8 +73,8 @@ if (!defined('RCUBE_LOCALIZATION_DIR')) {
// set internal encoding for mbstring extension
if (extension_loaded('mbstring')) {
- mb_internal_encoding(RCMAIL_CHARSET);
- @mb_regex_encoding(RCMAIL_CHARSET);
+ mb_internal_encoding(RCUBE_CHARSET);
+ @mb_regex_encoding(RCUBE_CHARSET);
}
// Register autoloader
diff --git a/program/lib/Roundcube/html.php b/program/lib/Roundcube/html.php
index 8ff685a84..5fb574b97 100644
--- a/program/lib/Roundcube/html.php
+++ b/program/lib/Roundcube/html.php
@@ -335,7 +335,7 @@ class html
*/
public static function quote($str)
{
- return @htmlspecialchars($str, ENT_COMPAT, RCMAIL_CHARSET);
+ return @htmlspecialchars($str, ENT_COMPAT, RCUBE_CHARSET);
}
}
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index c798465ed..1ce6241c8 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -379,7 +379,7 @@ class rcube
{
$storage = $this->get_storage();
- $storage->set_charset($this->config->get('default_charset', RCMAIL_CHARSET));
+ $storage->set_charset($this->config->get('default_charset', RCUBE_CHARSET));
if ($default_folders = $this->config->get('default_folders')) {
$storage->set_default_folders($default_folders);
diff --git a/program/lib/Roundcube/rcube_charset.php b/program/lib/Roundcube/rcube_charset.php
index e8cce00e3..6135a5711 100644
--- a/program/lib/Roundcube/rcube_charset.php
+++ b/program/lib/Roundcube/rcube_charset.php
@@ -169,7 +169,7 @@ class rcube_charset
*
* @param string Input string
* @param string Suspected charset of the input string
- * @param string Target charset to convert to; defaults to RCMAIL_CHARSET
+ * @param string Target charset to convert to; defaults to RCUBE_CHARSET
*
* @return string Converted string
*/
@@ -180,7 +180,7 @@ class rcube_charset
static $mbstring_sch = null;
static $conv = null;
- $to = empty($to) ? RCMAIL_CHARSET : $to;
+ $to = empty($to) ? RCUBE_CHARSET : $to;
$from = self::parse_charset($from);
// It is a common case when UTF-16 charset is used with US-ASCII content (#1488654)
diff --git a/program/lib/Roundcube/rcube_config.php b/program/lib/Roundcube/rcube_config.php
index 8112d2ece..615faf3ad 100644
--- a/program/lib/Roundcube/rcube_config.php
+++ b/program/lib/Roundcube/rcube_config.php
@@ -101,11 +101,11 @@ class rcube_config
// fix default imap folders encoding
foreach (array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox') as $folder)
- $this->prop[$folder] = rcube_charset::convert($this->prop[$folder], RCMAIL_CHARSET, 'UTF7-IMAP');
+ $this->prop[$folder] = rcube_charset::convert($this->prop[$folder], RCUBE_CHARSET, 'UTF7-IMAP');
if (!empty($this->prop['default_folders']))
foreach ($this->prop['default_folders'] as $n => $folder)
- $this->prop['default_folders'][$n] = rcube_charset::convert($folder, RCMAIL_CHARSET, 'UTF7-IMAP');
+ $this->prop['default_folders'][$n] = rcube_charset::convert($folder, RCUBE_CHARSET, 'UTF7-IMAP');
// set PHP error logging according to config
if ($this->prop['debug_level'] & 1) {
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index e4500c744..5b4292a4c 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -698,7 +698,7 @@ class rcube_contacts extends rcube_addressbook
if ($sql_arr['vcard']) {
unset($sql_arr['email']);
- $vcard = new rcube_vcard($sql_arr['vcard'], RCMAIL_CHARSET, false, $this->vcard_fieldmap);
+ $vcard = new rcube_vcard($sql_arr['vcard'], RCUBE_CHARSET, false, $this->vcard_fieldmap);
$record += $vcard->get_assoc() + $sql_arr;
}
else {
@@ -717,7 +717,7 @@ class rcube_contacts extends rcube_addressbook
$words = '';
// copy values into vcard object
- $vcard = new rcube_vcard($record['vcard'] ? $record['vcard'] : $save_data['vcard'], RCMAIL_CHARSET, false, $this->vcard_fieldmap);
+ $vcard = new rcube_vcard($record['vcard'] ? $record['vcard'] : $save_data['vcard'], RCUBE_CHARSET, false, $this->vcard_fieldmap);
$vcard->reset();
foreach ($save_data as $key => $values) {
list($field, $section) = explode(':', $key);
diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php
index ec7a3ab41..850c0c4c3 100644
--- a/program/lib/Roundcube/rcube_csv2vcard.php
+++ b/program/lib/Roundcube/rcube_csv2vcard.php
@@ -265,7 +265,7 @@ class rcube_csv2vcard
// convert to UTF-8
$head = substr($csv, 0, 4096);
$fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1'); // fallback to Latin-1?
- $charset = rcube_charset::detect($head, RCMAIL_CHARSET);
+ $charset = rcube_charset::detect($head, RCUBE_CHARSET);
$csv = rcube_charset::convert($csv, $charset);
$head = '';
diff --git a/program/lib/Roundcube/rcube_mime.php b/program/lib/Roundcube/rcube_mime.php
index 25ee31d64..98761c503 100644
--- a/program/lib/Roundcube/rcube_mime.php
+++ b/program/lib/Roundcube/rcube_mime.php
@@ -59,7 +59,7 @@ class rcube_mime
return $charset;
}
- return RCMAIL_CHARSET;
+ return RCUBE_CHARSET;
}
@@ -572,8 +572,9 @@ class rcube_mime
*/
public static function wordwrap($string, $width=75, $break="\n", $cut=false, $charset=null)
{
- if ($charset && function_exists('mb_internal_encoding'))
+ if ($charset && function_exists('mb_internal_encoding')) {
mb_internal_encoding($charset);
+ }
$para = preg_split('/\r?\n/', $string);
$string = '';
@@ -629,8 +630,9 @@ class rcube_mime
}
}
- if ($charset && function_exists('mb_internal_encoding'))
- mb_internal_encoding(RCMAIL_CHARSET);
+ if ($charset && function_exists('mb_internal_encoding')) {
+ mb_internal_encoding(RCUBE_CHARSET);
+ }
return $string;
}
diff --git a/program/lib/Roundcube/rcube_output.php b/program/lib/Roundcube/rcube_output.php
index f7ac3002f..3f881fe06 100644
--- a/program/lib/Roundcube/rcube_output.php
+++ b/program/lib/Roundcube/rcube_output.php
@@ -34,7 +34,7 @@ abstract class rcube_output
protected $app;
protected $config;
- protected $charset = RCMAIL_CHARSET;
+ protected $charset = RCUBE_CHARSET;
protected $env = array();
protected $pagetitle = '';
protected $object_handlers = array();
diff --git a/program/lib/Roundcube/rcube_output_html.php b/program/lib/Roundcube/rcube_output_html.php
index 0d51eaf06..6c9dfdd1f 100644
--- a/program/lib/Roundcube/rcube_output_html.php
+++ b/program/lib/Roundcube/rcube_output_html.php
@@ -1364,8 +1364,8 @@ class rcube_output_html extends rcube_output
// trigger hook with final HTML content to be sent
$hook = $this->app->plugins->exec_hook("send_page", array('content' => $output));
if (!$hook['abort']) {
- if ($this->charset != RCMAIL_CHARSET) {
- echo rcube_charset::convert($hook['content'], RCMAIL_CHARSET, $this->charset);
+ if ($this->charset != RCUBE_CHARSET) {
+ echo rcube_charset::convert($hook['content'], RCUBE_CHARSET, $this->charset);
}
else {
echo $hook['content'];
diff --git a/program/lib/Roundcube/rcube_spellchecker.php b/program/lib/Roundcube/rcube_spellchecker.php
index 30d15d721..fce2cac75 100644
--- a/program/lib/Roundcube/rcube_spellchecker.php
+++ b/program/lib/Roundcube/rcube_spellchecker.php
@@ -150,7 +150,7 @@ class rcube_spellchecker
function get_xml()
{
// send output
- $out = '<?xml version="1.0" encoding="'.RCMAIL_CHARSET.'"?><spellresult charschecked="'.mb_strlen($this->content).'">';
+ $out = '<?xml version="1.0" encoding="'.RCUBE_CHARSET.'"?><spellresult charschecked="'.mb_strlen($this->content).'">';
foreach ($this->matches as $item) {
$out .= '<c o="'.$item[1].'" l="'.$item[2].'">';
@@ -178,7 +178,7 @@ class rcube_spellchecker
$word = $item[0];
}
else {
- $word = mb_substr($this->content, $item[1], $item[2], RCMAIL_CHARSET);
+ $word = mb_substr($this->content, $item[1], $item[2], RCUBE_CHARSET);
}
$result[$word] = is_array($item[4]) ? implode("\t", $item[4]) : $item[4];
}
@@ -326,7 +326,7 @@ class rcube_spellchecker
return;
}
- $this->plink = pspell_new($this->lang, null, null, RCMAIL_CHARSET, PSPELL_FAST);
+ $this->plink = pspell_new($this->lang, null, null, RCUBE_CHARSET, PSPELL_FAST);
}
if (!$this->plink) {
@@ -387,7 +387,7 @@ class rcube_spellchecker
|| !empty($this->options['ignore_caps']) || !empty($this->options['dictionary'])
) {
foreach ($matches as $idx => $m) {
- $word = mb_substr($text, $m[1], $m[2], RCMAIL_CHARSET);
+ $word = mb_substr($text, $m[1], $m[2], RCUBE_CHARSET);
// skip exceptions
if ($this->is_exception($word)) {
unset($matches[$idx]);
@@ -416,7 +416,7 @@ class rcube_spellchecker
$result = array();
foreach ($matches as $m) {
- $result[] = mb_substr($text, $m[1], $m[2], RCMAIL_CHARSET);
+ $result[] = mb_substr($text, $m[1], $m[2], RCUBE_CHARSET);
}
return $result;
diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php
index 7b59e206d..45ee601e5 100644
--- a/program/lib/Roundcube/rcube_vcard.php
+++ b/program/lib/Roundcube/rcube_vcard.php
@@ -70,7 +70,7 @@ class rcube_vcard
/**
* Constructor
*/
- public function __construct($vcard = null, $charset = RCMAIL_CHARSET, $detect = false, $fieldmap = array())
+ public function __construct($vcard = null, $charset = RCUBE_CHARSET, $detect = false, $fieldmap = array())
{
if (!empty($fielmap))
$this->extend_fieldmap($fieldmap);
@@ -87,7 +87,7 @@ class rcube_vcard
* @param string Charset of string values
* @param boolean True if loading a 'foreign' vcard and extra heuristics for charset detection is required
*/
- public function load($vcard, $charset = RCMAIL_CHARSET, $detect = false)
+ public function load($vcard, $charset = RCUBE_CHARSET, $detect = false)
{
self::$values_decoded = false;
$this->raw = self::vcard_decode($vcard);
@@ -98,7 +98,7 @@ class rcube_vcard
}
// vcard has encoded values and charset should be detected
else if ($detect && self::$values_decoded &&
- ($detected_charset = self::detect_encoding(self::vcard_encode($this->raw))) && $detected_charset != RCMAIL_CHARSET) {
+ ($detected_charset = self::detect_encoding(self::vcard_encode($this->raw))) && $detected_charset != RCUBE_CHARSET) {
$this->raw = self::charset_convert($this->raw, $detected_charset);
}
@@ -436,10 +436,10 @@ class rcube_vcard
if (preg_match('/charset=/i', substr($data, 0, 2048)))
$charset = null;
// detect charset and convert to utf-8
- else if (($charset = self::detect_encoding($data)) && $charset != RCMAIL_CHARSET) {
+ else if (($charset = self::detect_encoding($data)) && $charset != RCUBE_CHARSET) {
$data = rcube_charset::convert($data, $charset);
$data = preg_replace(array('/^[\xFE\xFF]{2}/', '/^\xEF\xBB\xBF/', '/^\x00+/'), '', $data); // also remove BOM
- $charset = RCMAIL_CHARSET;
+ $charset = RCUBE_CHARSET;
}
$vcard_block = '';