From a125b2558ca359e6eacc6326816edac68b1b93a3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sat, 17 Jul 2010 15:35:07 +0000 Subject: [PATCH] Refresh all patches so that they apply without any fuzz --- debian/patches/changeset_r3170.patch | 326 +++++++++--------- debian/patches/changeset_r3202.patch | 22 +- debian/patches/correct-magic-path.patch | 12 +- debian/patches/correct_install_path.patch | 8 +- debian/patches/dbconfig-common_support.patch | 17 +- debian/patches/default-charset-utf8.patch | 6 +- debian/patches/disable-dns-prefetch.patch | 6 +- .../patches/dont-limit-email-local-part.patch | 6 +- debian/patches/loginbox-size.patch | 8 +- debian/patches/use_packaged_tinymce.patch | 8 +- debian/patches/use_pspell.patch | 8 +- 11 files changed, 228 insertions(+), 199 deletions(-) diff --git a/debian/patches/changeset_r3170.patch b/debian/patches/changeset_r3170.patch index f820edc..962a626 100644 --- a/debian/patches/changeset_r3170.patch +++ b/debian/patches/changeset_r3170.patch @@ -1,159 +1,171 @@ Use json_encode to ensure compatibility with JQuery 1.4. -Index: roundcubemail/program/include/rcube_template.php -=================================================================== ---- roundcubemail/program/include/rcube_template.php (revision 2980) -+++ roundcubemail/program/include/rcube_template.php (revision 3170) -@@ -415,10 +415,10 @@ - $out = ''; - if (!$this->framed && !empty($this->js_env)) { -- $out .= JS_OBJECT_NAME . '.set_env('.json_serialize($this->js_env).");\n"; -+ $out .= JS_OBJECT_NAME . '.set_env('.json_encode($this->js_env).");\n"; - } - foreach ($this->js_commands as $i => $args) { - $method = array_shift($args); - foreach ($args as $i => $arg) { -- $args[$i] = json_serialize($arg); -+ $args[$i] = json_encode($arg); - } - $parent = $this->framed || preg_match('/^parent\./', $method); -Index: roundcubemail/program/include/rcube_shared.inc -=================================================================== ---- roundcubemail/program/include/rcube_shared.inc (revision 3132) -+++ roundcubemail/program/include/rcube_shared.inc (revision 3170) -@@ -106,95 +106,4 @@ - exit; - } --} -- -- --/** -- * Returns whether an $str is a reserved word for any of the version of Javascript or ECMAScript -- * @param str String to check -- * @return boolean True if $str is a reserver word, False if not -- */ --function is_js_reserved_word($str) --{ -- return in_array($str, array( -- // ECMASript ver 4 reserved words -- 'as','break','case','catch','class','const','continue', -- 'default','delete','do','else','export','extends','false','finally','for','function', -- 'if','import','in','instanceof','is','namespace','new','null','package','private', -- 'public','return','super','switch','this','throw','true','try','typeof','use','var', -- 'void','while','with', -- // ECMAScript ver 4 future reserved words -- 'abstract','debugger','enum','goto','implements','interface','native','protected', -- 'synchronized','throws','transient','volatile', -- // special meaning in some contexts -- 'get','set', -- // were reserved in ECMAScript ver 3 -- 'boolean','byte','char','double','final','float','int','long','short','static' -- )); --} -- -- --/** -- * Convert a variable into a javascript object notation -- * -- * @param mixed Input value -- * @return string Serialized JSON string -- */ --function json_serialize($var) --{ -- if (is_object($var)) -- $var = get_object_vars($var); -- -- if (is_array($var)) -- { -- // empty array -- if (!sizeof($var)) -- return '[]'; -- else -- { -- $keys_arr = array_keys($var); -- $is_assoc = $have_numeric = 0; -- -- for ($i=0; $i $value) -- { -- // enclose key with quotes if it is not variable-name conform -- if (!preg_match('/^[_a-zA-Z]{1}[_a-zA-Z0-9]*$/', $key) || is_js_reserved_word($key)) -- $key = "'$key'"; -- -- $pairs[] = sprintf("%s%s", $is_assoc ? "$key:" : '', json_serialize($value)); -- } -- -- return $brackets{0} . implode(',', $pairs) . $brackets{1}; -- } -- } -- else if (!is_string($var) && strval(intval($var)) === strval($var)) -- return $var; -- else if (is_bool($var)) -- return $var ? '1' : '0'; -- else -- return "'".JQ($var)."'"; --} -- -- --/** -- * Function to convert an array to a javascript array -- * Actually an alias function for json_serialize() -- * @deprecated -- */ --function array2js($arr, $type='') --{ -- return json_serialize($arr); - } - -Index: roundcubemail/program/include/rcube_json_output.php -=================================================================== ---- roundcubemail/program/include/rcube_json_output.php (revision 2905) -+++ roundcubemail/program/include/rcube_json_output.php (revision 3170) -@@ -240,5 +240,5 @@ - $response['callbacks'] = $this->callbacks; - -- echo json_serialize($response); -+ echo json_encode($response); - } - -@@ -256,5 +256,5 @@ - $method = array_shift($args); - foreach ($args as $i => $arg) { -- $args[$i] = json_serialize($arg); -+ $args[$i] = json_encode($arg); - } - -Index: roundcubemail/program/steps/mail/func.inc -=================================================================== ---- roundcubemail/program/steps/mail/func.inc (revision 3099) -+++ roundcubemail/program/steps/mail/func.inc (revision 3170) -@@ -523,5 +523,5 @@ - if (is_array($quota)) { - $OUTPUT->add_script('$(document).ready(function(){ -- rcmail.set_quota('.json_serialize($quota).')});', 'foot'); -+ rcmail.set_quota('.json_encode($quota).')});', 'foot'); - $quota = ''; - } -Index: roundcubemail/program/steps/mail/compose.inc -=================================================================== ---- roundcubemail/program/steps/mail/compose.inc (revision 3166) -+++ roundcubemail/program/steps/mail/compose.inc (revision 3170) -@@ -507,5 +507,5 @@ - JQ(Q(rcube_label('revertto'))), - JQ(Q(rcube_label('nospellerrors'))), -- json_serialize($spellcheck_langs), -+ json_encode($spellcheck_langs), - $lang, - $attrib['id'], +Index: b/program/include/rcube_json_output.php +=================================================================== +--- a/program/include/rcube_json_output.php 2009-09-01 17:13:45.000000000 +0200 ++++ b/program/include/rcube_json_output.php 2010-07-17 17:33:24.000000000 +0200 +@@ -239,7 +239,7 @@ + if (!empty($this->callbacks)) + $response['callbacks'] = $this->callbacks; + +- echo json_serialize($response); ++ echo json_encode($response); + } + + +@@ -255,7 +255,7 @@ + foreach ($this->commands as $i => $args) { + $method = array_shift($args); + foreach ($args as $i => $arg) { +- $args[$i] = json_serialize($arg); ++ $args[$i] = json_encode($arg); + } + + $out .= sprintf( +Index: b/program/include/rcube_shared.inc +=================================================================== +--- a/program/include/rcube_shared.inc 2009-10-27 10:43:39.000000000 +0100 ++++ b/program/include/rcube_shared.inc 2010-07-17 17:33:24.000000000 +0200 +@@ -109,97 +109,6 @@ + + + /** +- * Returns whether an $str is a reserved word for any of the version of Javascript or ECMAScript +- * @param str String to check +- * @return boolean True if $str is a reserver word, False if not +- */ +-function is_js_reserved_word($str) +-{ +- return in_array($str, array( +- // ECMASript ver 4 reserved words +- 'as','break','case','catch','class','const','continue', +- 'default','delete','do','else','export','extends','false','finally','for','function', +- 'if','import','in','instanceof','is','namespace','new','null','package','private', +- 'public','return','super','switch','this','throw','true','try','typeof','use','var', +- 'void','while','with', +- // ECMAScript ver 4 future reserved words +- 'abstract','debugger','enum','goto','implements','interface','native','protected', +- 'synchronized','throws','transient','volatile', +- // special meaning in some contexts +- 'get','set', +- // were reserved in ECMAScript ver 3 +- 'boolean','byte','char','double','final','float','int','long','short','static' +- )); +-} +- +- +-/** +- * Convert a variable into a javascript object notation +- * +- * @param mixed Input value +- * @return string Serialized JSON string +- */ +-function json_serialize($var) +-{ +- if (is_object($var)) +- $var = get_object_vars($var); +- +- if (is_array($var)) +- { +- // empty array +- if (!sizeof($var)) +- return '[]'; +- else +- { +- $keys_arr = array_keys($var); +- $is_assoc = $have_numeric = 0; +- +- for ($i=0; $i $value) +- { +- // enclose key with quotes if it is not variable-name conform +- if (!preg_match('/^[_a-zA-Z]{1}[_a-zA-Z0-9]*$/', $key) || is_js_reserved_word($key)) +- $key = "'$key'"; +- +- $pairs[] = sprintf("%s%s", $is_assoc ? "$key:" : '', json_serialize($value)); +- } +- +- return $brackets{0} . implode(',', $pairs) . $brackets{1}; +- } +- } +- else if (!is_string($var) && strval(intval($var)) === strval($var)) +- return $var; +- else if (is_bool($var)) +- return $var ? '1' : '0'; +- else +- return "'".JQ($var)."'"; +-} +- +- +-/** +- * Function to convert an array to a javascript array +- * Actually an alias function for json_serialize() +- * @deprecated +- */ +-function array2js($arr, $type='') +-{ +- return json_serialize($arr); +-} +- +- +-/** + * Similar function as in_array() but case-insensitive + * + * @param mixed Needle value +Index: b/program/include/rcube_template.php +=================================================================== +--- a/program/include/rcube_template.php 2009-09-22 20:08:45.000000000 +0200 ++++ b/program/include/rcube_template.php 2010-07-17 17:33:24.000000000 +0200 +@@ -414,12 +414,12 @@ + { + $out = ''; + if (!$this->framed && !empty($this->js_env)) { +- $out .= JS_OBJECT_NAME . '.set_env('.json_serialize($this->js_env).");\n"; ++ $out .= JS_OBJECT_NAME . '.set_env('.json_encode($this->js_env).");\n"; + } + foreach ($this->js_commands as $i => $args) { + $method = array_shift($args); + foreach ($args as $i => $arg) { +- $args[$i] = json_serialize($arg); ++ $args[$i] = json_encode($arg); + } + $parent = $this->framed || preg_match('/^parent\./', $method); + $out .= sprintf( +Index: b/program/steps/mail/compose.inc +=================================================================== +--- a/program/steps/mail/compose.inc 2009-10-06 08:55:08.000000000 +0200 ++++ b/program/steps/mail/compose.inc 2010-07-17 17:33:24.000000000 +0200 +@@ -493,7 +493,7 @@ + JQ(Q(rcube_label('close'))), + JQ(Q(rcube_label('revertto'))), + JQ(Q(rcube_label('nospellerrors'))), +- json_serialize($spellcheck_langs), ++ json_encode($spellcheck_langs), + $lang, + $attrib['id'], + JS_OBJECT_NAME), 'foot'); +Index: b/program/steps/mail/func.inc +=================================================================== +--- a/program/steps/mail/func.inc 2009-10-24 21:09:23.000000000 +0200 ++++ b/program/steps/mail/func.inc 2010-07-17 17:33:24.000000000 +0200 +@@ -522,7 +522,7 @@ + + if (is_array($quota)) { + $OUTPUT->add_script('$(document).ready(function(){ +- rcmail.set_quota('.json_serialize($quota).')});', 'foot'); ++ rcmail.set_quota('.json_encode($quota).')});', 'foot'); + $quota = ''; + } + diff --git a/debian/patches/changeset_r3202.patch b/debian/patches/changeset_r3202.patch index 645734b..5b889ee 100644 --- a/debian/patches/changeset_r3202.patch +++ b/debian/patches/changeset_r3202.patch @@ -1,12 +1,14 @@ Compatibility with jQuery 1.4. -Index: roundcubemail/program/include/rcube_json_output.php -=================================================================== ---- roundcubemail/program/include/rcube_json_output.php (revision 3175) -+++ roundcubemail/program/include/rcube_json_output.php (revision 3202) -@@ -219,5 +219,4 @@ - send_nocacheing_headers(); - header('Content-Type: text/plain; charset=' . $this->get_charset()); -- print '/** ajax response ['.date('d/M/Y h:i:s O')."] **/\n"; - } - +Index: b/program/include/rcube_json_output.php +=================================================================== +--- a/program/include/rcube_json_output.php 2010-07-17 17:33:24.000000000 +0200 ++++ b/program/include/rcube_json_output.php 2010-07-17 17:33:24.000000000 +0200 +@@ -218,7 +218,6 @@ + $s_header_sent = true; + send_nocacheing_headers(); + header('Content-Type: text/plain; charset=' . $this->get_charset()); +- print '/** ajax response ['.date('d/M/Y h:i:s O')."] **/\n"; + } + + // unset default env vars diff --git a/debian/patches/correct-magic-path.patch b/debian/patches/correct-magic-path.patch index de9330f..e2ca99f 100644 --- a/debian/patches/correct-magic-path.patch +++ b/debian/patches/correct-magic-path.patch @@ -1,13 +1,15 @@ On Debian, the magic file is in /usr/share/file/magic. ---- roundcube-0.1/config/main.inc.php.dist~ 2008-02-21 11:27:19.000000000 +0100 -+++ roundcube-0.1/config/main.inc.php.dist 2008-03-06 14:04:53.000000000 +0100 -@@ -277,7 +277,7 @@ +Index: b/config/main.inc.php.dist +=================================================================== +--- a/config/main.inc.php.dist 2009-10-21 10:47:40.000000000 +0200 ++++ b/config/main.inc.php.dist 2010-07-17 17:33:23.000000000 +0200 +@@ -338,7 +338,7 @@ $rcmail_config['max_pagesize'] = 200; // mime magic database -$rcmail_config['mime_magic'] = '/usr/share/misc/magic'; +$rcmail_config['mime_magic'] = '/usr/share/file/magic'; - // end of config file - ?> + // default sort col + $rcmail_config['message_sort_col'] = 'date'; diff --git a/debian/patches/correct_install_path.patch b/debian/patches/correct_install_path.patch index b8e6daa..04ec738 100644 --- a/debian/patches/correct_install_path.patch +++ b/debian/patches/correct_install_path.patch @@ -1,7 +1,9 @@ Install path is /var/lib/roundcube for Debian. Don't try to guess it. ---- a/program/include/iniset.php~ 2008-06-09 22:57:53.000000000 +0200 -+++ a/program/include/iniset.php 2008-06-22 12:10:55.000000000 +0200 +Index: b/program/include/iniset.php +=================================================================== +--- a/program/include/iniset.php 2010-07-17 17:33:04.000000000 +0200 ++++ b/program/include/iniset.php 2010-07-17 17:33:23.000000000 +0200 @@ -27,7 +27,7 @@ define('JS_OBJECT_NAME', 'rcmail'); @@ -10,4 +12,4 @@ Install path is /var/lib/roundcube for Debian. Don't try to guess it. + define('INSTALL_PATH', '/var/lib/roundcube/'); } - // make sure path_separator is defined + define('RCMAIL_CONFIG_DIR', INSTALL_PATH . 'config'); diff --git a/debian/patches/dbconfig-common_support.patch b/debian/patches/dbconfig-common_support.patch index 61938fa..fbc2c0e 100644 --- a/debian/patches/dbconfig-common_support.patch +++ b/debian/patches/dbconfig-common_support.patch @@ -1,22 +1,23 @@ The default db.inc.php is modified to adapt it to the use of dbconfig-common package. ---- roundcube_0.1~beta2.2/config/db.inc.php.dist 2006-03-20 23:08:51.000000000 +0100 -+++ roundcube_0.1~beta2.2/config/db.inc.php.dist 2007-03-13 14:33:38.000000000 +0100 +Index: b/config/db.inc.php.dist +=================================================================== +--- a/config/db.inc.php.dist 2010-07-17 17:33:04.000000000 +0200 ++++ b/config/db.inc.php.dist 2010-07-17 17:33:23.000000000 +0200 @@ -14,15 +14,20 @@ - + $rcmail_config = array(); - + -// PEAR database DSN for read/write operations -// format is db_provider://user:password@host/database -// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php -// currently supported db_providers: mysql, mysqli, pgsql, sqlite, mssql -- ++/* Do not set db_dsnw here, use dpkg-reconfigure roundcube to configure database ! */ + -$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail'; -// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail'; -// Warning: for SQLite use absolute path in DSN: -// sqlite example: 'sqlite:////full/path/to/sqlite.db?mode=0646'; -+/* Do not set db_dsnw here, use dpkg-reconfigure roundcube to configure database ! */ -+ +include_once("/etc/roundcube/debian-db.php"); + +switch ($dbtype) { @@ -29,6 +30,6 @@ The default db.inc.php is modified to adapt it to the use of dbconfig-common pac + $rcmail_config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname"; + break; + } - + // PEAR database DSN for read only operations (if empty write database will be used) // useful for database replication diff --git a/debian/patches/default-charset-utf8.patch b/debian/patches/default-charset-utf8.patch index 2122f21..24c3ea5 100644 --- a/debian/patches/default-charset-utf8.patch +++ b/debian/patches/default-charset-utf8.patch @@ -1,7 +1,9 @@ Switch to UTF-8 as default charset ---- roundcubemail-0.3.1-dep/config/main.inc.php.dist~ 2009-10-21 10:47:40.000000000 +0200 -+++ roundcubemail-0.3.1-dep/config/main.inc.php.dist 2010-07-10 18:06:50.000000000 +0200 +Index: b/config/main.inc.php.dist +=================================================================== +--- a/config/main.inc.php.dist 2010-07-17 17:33:24.000000000 +0200 ++++ b/config/main.inc.php.dist 2010-07-17 17:33:25.000000000 +0200 @@ -215,7 +215,7 @@ $rcmail_config['mdn_requests'] = 0; diff --git a/debian/patches/disable-dns-prefetch.patch b/debian/patches/disable-dns-prefetch.patch index 450145f..6f6c6d8 100644 --- a/debian/patches/disable-dns-prefetch.patch +++ b/debian/patches/disable-dns-prefetch.patch @@ -1,9 +1,9 @@ Disable DNS prefetching to solve CVE-2010-0464. -Index: program/include/rcube_html_page.php +Index: b/program/include/rcube_html_page.php =================================================================== ---- rcube/program/include/rcube_html_page.php (revision 3214) -+++ rcube/program/include/rcube_html_page.php (working copy) +--- a/program/include/rcube_html_page.php 2009-06-22 18:20:34.000000000 +0200 ++++ b/program/include/rcube_html_page.php 2010-07-17 17:33:25.000000000 +0200 @@ -165,6 +165,13 @@ $__page_header.= $this->charset . '" />'."\n"; } diff --git a/debian/patches/dont-limit-email-local-part.patch b/debian/patches/dont-limit-email-local-part.patch index c9852aa..27cb519 100644 --- a/debian/patches/dont-limit-email-local-part.patch +++ b/debian/patches/dont-limit-email-local-part.patch @@ -1,6 +1,8 @@ To fix #568360 and #568537, don't limit local part size. ---- roundcube-0.3.1/program/include/main.inc~ 2009-10-31 14:44:19.751802878 +0100 -+++ roundcube-0.3.1/program/include/main.inc 2010-02-05 19:46:12.000000000 +0100 +Index: b/program/include/main.inc +=================================================================== +--- a/program/include/main.inc 2009-10-31 14:44:19.000000000 +0100 ++++ b/program/include/main.inc 2010-07-17 17:33:25.000000000 +0200 @@ -1427,7 +1427,7 @@ return false; diff --git a/debian/patches/loginbox-size.patch b/debian/patches/loginbox-size.patch index 7e04ce5..ce56b9f 100644 --- a/debian/patches/loginbox-size.patch +++ b/debian/patches/loginbox-size.patch @@ -1,8 +1,10 @@ Fix size of login box to accommodate sk_SK locale ---- r/skins/default/common.css~ 2009-09-04 12:42:24.000000000 +0200 -+++ r/skins/default/common.css 2009-09-27 11:27:25.000000000 +0200 -@@ -494,7 +494,7 @@ +Index: b/skins/default/common.css +=================================================================== +--- a/skins/default/common.css 2009-10-06 12:00:33.000000000 +0200 ++++ b/skins/default/common.css 2010-07-17 17:33:24.000000000 +0200 +@@ -506,7 +506,7 @@ margin-left: auto; margin-right: auto; margin-top: 50px; diff --git a/debian/patches/use_packaged_tinymce.patch b/debian/patches/use_packaged_tinymce.patch index f2a7a91..a498c59 100644 --- a/debian/patches/use_packaged_tinymce.patch +++ b/debian/patches/use_packaged_tinymce.patch @@ -1,8 +1,10 @@ Use tinymce from tinycme package instead of the shipped one. ---- roundcube-0.1~rc2.orig/program/steps/mail/sendmail.inc 2007-11-26 11:42:36.000000000 +0100 -+++ roundcube-0.1~rc2/program/steps/mail/sendmail.inc 2007-11-26 11:44:04.000000000 +0100 -@@ -123,7 +123,7 @@ +Index: b/program/steps/mail/sendmail.inc +=================================================================== +--- a/program/steps/mail/sendmail.inc 2009-10-14 12:52:27.000000000 +0200 ++++ b/program/steps/mail/sendmail.inc 2010-07-17 17:33:23.000000000 +0200 +@@ -128,7 +128,7 @@ // sanitize image name so resulting attachment doesn't leave images dir $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i', '', $image_name); diff --git a/debian/patches/use_pspell.patch b/debian/patches/use_pspell.patch index 843097d..d3ade03 100644 --- a/debian/patches/use_pspell.patch +++ b/debian/patches/use_pspell.patch @@ -1,8 +1,10 @@ Instead of using Google by default, we use pspell to avoid to send each mail to Google... ---- roundcube-0.1/config/main.inc.php.dist~ 2009-05-15 12:22:29.000000000 +0200 -+++ roundcube-0.1/config/main.inc.php.dist 2009-07-05 09:59:26.000000000 +0200 -@@ -199,7 +199,7 @@ +Index: b/config/main.inc.php.dist +=================================================================== +--- a/config/main.inc.php.dist 2010-07-17 17:33:23.000000000 +0200 ++++ b/config/main.inc.php.dist 2010-07-17 17:33:24.000000000 +0200 +@@ -224,7 +224,7 @@ // Set the spell checking engine. 'googie' is the default. 'pspell' is also available, // but requires the Pspell extensions. When using Nox Spell Server, also set 'googie' here. -- 2.39.2