diff options
29 files changed, 97 insertions, 81 deletions
@@ -1,6 +1,10 @@ CHANGELOG Roundcube Webmail =========================== +- Fix drag-n-drop to folders expanded while dragging (#1490157) + +RELEASE 1.1-beta +---------------- - Fix skin path handling in plugin context (#1488967) - Prevent memory exhaustion on image resizing with GD on Windows (#1489937) - Add plugin hook for database table name lookups as requested in #1489837 @@ -66,6 +70,7 @@ CHANGELOG Roundcube Webmail - Fix bug where creating subfolders in shared folders wasn't possible without ACL extension (#1490113) - Fix reply scrolling issue with text mode and start message below the quote (#1490114) - Fix possible issues in skin/skin_path config handling (#1490125) +- Fix lack of delimiter for recipient addresses in smtp_log (#1490150) RELEASE 1.0.3 ------------- diff --git a/program/include/rcmail_install.php b/program/include/rcmail_install.php index 7877b8e33..96e0afbd4 100644 --- a/program/include/rcmail_install.php +++ b/program/include/rcmail_install.php @@ -290,7 +290,7 @@ class rcmail_install $out = $seen = array(); // iterate over the current configuration - foreach ($this->config as $prop => $value) { + foreach (array_keys($this->config) as $prop) { if ($replacement = $this->replaced_config[$prop]) { $out['replaced'][] = array('prop' => $prop, 'replacement' => $replacement); $seen[$replacement] = true; diff --git a/program/js/treelist.js b/program/js/treelist.js index c034f77b8..08e0e686d 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -911,9 +911,9 @@ function rcube_treelist_widget(node, p) * When dragging starts, compute absolute bounding boxes of the list and it's items * for faster comparisons while mouse is moving */ - function drag_start() + function drag_start(force) { - if (drag_active) + if (!force && drag_active) return; drag_active = true; @@ -1054,7 +1054,7 @@ function rcube_treelist_widget(node, p) autoexpand_item = id; autoexpand_timer = setTimeout(function() { expand(autoexpand_item); - drag_start(); // re-calculate item coords + drag_start(true); // re-calculate item coords autoexpand_item = null; if (ui_droppable) $.ui.ddmanager.prepareOffsets($.ui.ddmanager.current, null); diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index fe9c389fe..af87beb24 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -408,7 +408,7 @@ if (!extension_loaded('mbstring')) if (!function_exists('idn_to_utf8')) { - function idn_to_utf8($domain, $flags=null) + function idn_to_utf8($domain) { static $idn, $loaded; @@ -430,7 +430,7 @@ if (!function_exists('idn_to_utf8')) if (!function_exists('idn_to_ascii')) { - function idn_to_ascii($domain, $flags=null) + function idn_to_ascii($domain) { static $idn, $loaded; diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index 03f49637c..689823fcb 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -1551,7 +1551,7 @@ class rcube // send thru SMTP server using custom SMTP library if ($this->config->get('smtp_server')) { // generate list of recipients - $a_recipients = array($mailto); + $a_recipients = (array) $mailto; if (strlen($headers['Cc'])) $a_recipients[] = $headers['Cc']; @@ -1651,19 +1651,24 @@ class rcube // remove MDN headers after sending unset($headers['Return-Receipt-To'], $headers['Disposition-Notification-To']); - // get all recipients - if ($headers['Cc']) - $mailto .= $headers['Cc']; - if ($headers['Bcc']) - $mailto .= $headers['Bcc']; - if (preg_match_all('/<([^@]+@[^>]+)>/', $mailto, $m)) - $mailto = implode(', ', array_unique($m[1])); - if ($this->config->get('smtp_log')) { + // get all recipient addresses + if (is_array($mailto)) { + $mailto = implode(',', $mailto); + } + if ($headers['Cc']) { + $mailto .= ',' . $headers['Cc']; + } + if ($headers['Bcc']) { + $mailto .= ',' . $headers['Bcc']; + } + + $mailto = rcube_mime::decode_address_list($mailto, null, false, null, true); + self::write_log('sendmail', sprintf("User %s [%s]; Message for %s; %s", $this->user->get_username(), - $_SERVER['REMOTE_ADDR'], - $mailto, + rcube_utils::remote_addr(), + implode(', ', $mailto), !empty($response) ? join('; ', $response) : '')); } } diff --git a/program/lib/Roundcube/rcube_base_replacer.php b/program/lib/Roundcube/rcube_base_replacer.php index fa6764753..a306086ee 100644 --- a/program/lib/Roundcube/rcube_base_replacer.php +++ b/program/lib/Roundcube/rcube_base_replacer.php @@ -61,9 +61,6 @@ class rcube_base_replacer */ public static function absolute_url($path, $base_url) { - $host_url = $base_url; - $abs_path = $path; - // check if path is an absolute URL if (preg_match('/^[fhtps]+:\/\//', $path)) { return $path; @@ -74,6 +71,9 @@ class rcube_base_replacer return $path; } + $host_url = $base_url; + $abs_path = $path; + // cut base_url to the last directory if (strrpos($base_url, '/') > 7) { $host_url = substr($base_url, 0, strpos($base_url, '/', 7)); @@ -89,7 +89,8 @@ class rcube_base_replacer $path = preg_replace('/^\.\//', '', $path); if (preg_match_all('/\.\.\//', $path, $matches, PREG_SET_ORDER)) { - foreach ($matches as $a_match) { + $cnt = count($matches); + while ($cnt--) { if ($pos = strrpos($base_url, '/')) { $base_url = substr($base_url, 0, $pos); } diff --git a/program/lib/Roundcube/rcube_charset.php b/program/lib/Roundcube/rcube_charset.php index 3e2dac19c..c15c3ad55 100644 --- a/program/lib/Roundcube/rcube_charset.php +++ b/program/lib/Roundcube/rcube_charset.php @@ -175,7 +175,6 @@ class rcube_charset static $iconv_options = null; static $mbstring_list = null; static $mbstring_sch = null; - static $conv = null; $to = empty($to) ? RCUBE_CHARSET : $to; $from = self::parse_charset($from); diff --git a/program/lib/Roundcube/rcube_config.php b/program/lib/Roundcube/rcube_config.php index afe13e879..53409f26f 100644 --- a/program/lib/Roundcube/rcube_config.php +++ b/program/lib/Roundcube/rcube_config.php @@ -39,7 +39,6 @@ class rcube_config */ private $legacy_props = array( // new name => old name - 'default_folders' => 'default_imap_folders', 'mail_pagesize' => 'pagesize', 'addressbook_pagesize' => 'pagesize', 'reply_mode' => 'top_posting', @@ -143,10 +142,6 @@ class rcube_config foreach (array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox') as $folder) $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, RCUBE_CHARSET, 'UTF7-IMAP'); - // set PHP error logging according to config if ($this->prop['debug_level'] & 1) { ini_set('log_errors', 1); diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php index bd3a3f82b..6ac9fd5de 100644 --- a/program/lib/Roundcube/rcube_contacts.php +++ b/program/lib/Roundcube/rcube_contacts.php @@ -909,7 +909,7 @@ class rcube_contacts extends rcube_addressbook $name, $gid, $this->user_id ); - return $this->db->affected_rows() ? $name : false; + return $this->db->affected_rows($sql_result) ? $name : false; } @@ -983,7 +983,7 @@ class rcube_contacts extends rcube_addressbook $group_id ); - return $this->db->affected_rows(); + return $this->db->affected_rows($sql_result); } diff --git a/program/lib/Roundcube/rcube_content_filter.php b/program/lib/Roundcube/rcube_content_filter.php index ae6617d1b..7d3d02970 100644 --- a/program/lib/Roundcube/rcube_content_filter.php +++ b/program/lib/Roundcube/rcube_content_filter.php @@ -33,7 +33,7 @@ class rcube_content_filter extends php_user_filter return true; } - function filter($in, $out, &$consumed, $closing) + function filter($in, $out, &$consumed) { while ($bucket = stream_bucket_make_writeable($in)) { $this->buffer .= $bucket->data; diff --git a/program/lib/Roundcube/rcube_db_oracle.php b/program/lib/Roundcube/rcube_db_oracle.php index 362beb075..453746446 100644 --- a/program/lib/Roundcube/rcube_db_oracle.php +++ b/program/lib/Roundcube/rcube_db_oracle.php @@ -171,7 +171,7 @@ class rcube_db_oracle extends rcube_db $mode = $this->in_transaction ? OCI_NO_AUTO_COMMIT : OCI_COMMIT_ON_SUCCESS; if ($result) { - foreach ($args as $param => $arg) { + foreach (array_keys($args) as $param) { oci_bind_by_name($result, $param, $args[$param], -1, SQLT_LNG); } } @@ -587,7 +587,7 @@ class rcube_db_oracle extends rcube_db $this->debug('ROLLBACK TRANSACTION'); - if ($result = @oci_rollback($this->dbh)) { + if (@oci_rollback($this->dbh)) { $this->in_transaction = false; } else { diff --git a/program/lib/Roundcube/rcube_imap_generic.php b/program/lib/Roundcube/rcube_imap_generic.php index d78b526dd..450dcdce2 100644 --- a/program/lib/Roundcube/rcube_imap_generic.php +++ b/program/lib/Roundcube/rcube_imap_generic.php @@ -1108,7 +1108,8 @@ class rcube_imap_generic // folder name with spaces. Let's try to handle this situation if (!is_array($items) && ($pos = strpos($response, '(')) !== false) { $response = substr($response, $pos); - $items = $this->tokenizeResponse($response, 1); + $items = $this->tokenizeResponse($response, 1); + if (!is_array($items)) { return $result; } @@ -1704,7 +1705,6 @@ class rcube_imap_generic $encoding = $encoding ? trim($encoding) : 'US-ASCII'; $algorithm = $algorithm ? trim($algorithm) : 'REFERENCES'; $criteria = $criteria ? 'ALL '.trim($criteria) : 'ALL'; - $data = ''; list($code, $response) = $this->execute($return_uid ? 'UID THREAD' : 'THREAD', array($algorithm, $encoding, $criteria)); diff --git a/program/lib/Roundcube/rcube_imap_search.php b/program/lib/Roundcube/rcube_imap_search.php index 365d78f76..eac64b035 100644 --- a/program/lib/Roundcube/rcube_imap_search.php +++ b/program/lib/Roundcube/rcube_imap_search.php @@ -124,9 +124,7 @@ class rcube_imap_search_job /* extends Stackable */ private $charset; private $sort_field; private $threading; - private $searchset; private $result; - private $pagesize = 100; public function __construct($folder, $str, $charset = null, $sort_field = null, $threading=false) { diff --git a/program/lib/Roundcube/rcube_ldap.php b/program/lib/Roundcube/rcube_ldap.php index 6805c4902..9d7e6b836 100644 --- a/program/lib/Roundcube/rcube_ldap.php +++ b/program/lib/Roundcube/rcube_ldap.php @@ -64,7 +64,6 @@ class rcube_ldap extends rcube_addressbook private $base_dn = ''; private $groups_base_dn = ''; - private $group_url; private $group_data; private $group_search_cache; private $cache; @@ -775,7 +774,7 @@ class rcube_ldap extends rcube_addressbook // get all entries of this page and post-filter those that really match the query $search = mb_strtolower($value); - foreach ($ldap_data as $i => $entry) { + foreach ($ldap_data as $entry) { $rec = $this->_ldap2result($entry); foreach ($fields as $f) { foreach ((array)$rec[$f] as $val) { @@ -1531,7 +1530,6 @@ class rcube_ldap extends rcube_addressbook return $ldap_data; } - /** * Returns unified attribute name (resolving aliases) */ @@ -1563,17 +1561,6 @@ class rcube_ldap extends rcube_addressbook } /** - * Prints debug info to the log - */ - private function _debug($str) - { - if ($this->debug) { - rcube::write_log('ldap', $str); - } - } - - - /** * Activate/deactivate debug mode * * @param boolean $dbg True if LDAP commands should be logged @@ -1587,7 +1574,6 @@ class rcube_ldap extends rcube_addressbook } } - /** * Setter for the current group */ @@ -1990,7 +1976,7 @@ class rcube_ldap extends rcube_addressbook $filter = strtr("(|(member=$contact_dn)(uniqueMember=$contact_dn)$add_filter)", array('\\' => '\\\\')); $ldap_data = $this->ldap->search($base_dn, $filter, 'sub', array('dn', $name_attr)); - if ($res === false) { + if ($ldap_data === false) { return array(); } diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php index 169d00ce1..20329a7f1 100644 --- a/program/lib/Roundcube/rcube_message.php +++ b/program/lib/Roundcube/rcube_message.php @@ -550,12 +550,6 @@ class rcube_message else if ($mimetype == 'multipart/alternative' && is_array($structure->parts) && count($structure->parts) > 1 ) { - $plain_part = null; - $html_part = null; - $print_part = null; - $related_part = null; - $attach_part = null; - // get html/plaintext parts, other add to attachments list foreach ($structure->parts as $p => $sub_part) { $sub_mimetype = $sub_part->mimetype; diff --git a/program/lib/Roundcube/rcube_spellcheck_atd.php b/program/lib/Roundcube/rcube_spellcheck_atd.php index 9f073f56f..917ec0899 100644 --- a/program/lib/Roundcube/rcube_spellcheck_atd.php +++ b/program/lib/Roundcube/rcube_spellcheck_atd.php @@ -127,7 +127,7 @@ class rcube_spellcheck_atd extends rcube_spellcheck_engine $result = new SimpleXMLElement($response); } catch (Exception $e) { - $thid->error = "Unexpected response from server: " . $store; + $this->error = "Unexpected response from server: " . $response; return array(); } diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php index 96add110f..7f6b11851 100644 --- a/program/lib/Roundcube/rcube_vcard.php +++ b/program/lib/Roundcube/rcube_vcard.php @@ -414,9 +414,10 @@ class rcube_vcard * Find index with the '$type' attribute * * @param string Field name + * * @return int Field index having $type set */ - private function get_type_index($field, $type = 'pref') + private function get_type_index($field) { $result = 0; if ($this->raw[$field]) { diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 2c22d5a47..008d20174 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -279,8 +279,8 @@ function rcmail_savedsearch_list($attrib) // Saved searches $sources = $RCMAIL->user->list_searches(rcube_user::SEARCH_ADDRESSBOOK); - foreach ($sources as $j => $source) { - $id = $source['id']; + foreach ($sources as $source) { + $id = $source['id']; $js_id = rcube::JQ($id); // set class name(s) diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc index 5dee5c06a..80bae662c 100644 --- a/program/steps/addressbook/import.inc +++ b/program/steps/addressbook/import.inc @@ -324,7 +324,7 @@ function rcmail_import_buttons($attrib) function rcmail_import_group_id($group_name, $CONTACTS, $create, &$import_groups) { $group_id = 0; - foreach ($import_groups as $key => $group) { + foreach ($import_groups as $group) { if (strtolower($group['name']) == strtolower($group_name)) { $group_id = $group['ID']; break; diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 751729cc5..e655e7bf2 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -1309,7 +1309,6 @@ function rcmail_write_forward_attachments() } else { $data = $storage->get_raw_body($message->uid); - $curr_mem += $message->size; } $attachment = array( diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 167e30927..e33e965bd 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -647,7 +647,7 @@ function rcmail_message_list_head($attrib, $a_show_cols) */ function rcmail_messagecontent_frame($attrib) { - global $OUTPUT, $RCMAIL; + global $OUTPUT; if (empty($attrib['id'])) $attrib['id'] = 'rcmailcontentwindow'; @@ -1138,7 +1138,7 @@ function rcmail_localized_priority($value) /** * return block to show full message headers */ -function rcmail_message_full_headers($attrib, $headers=NULL) +function rcmail_message_full_headers($attrib) { global $OUTPUT, $RCMAIL; @@ -2051,7 +2051,7 @@ function rcmail_search_filter($attrib) return $out; } -function rcmail_message_error($uid=null) +function rcmail_message_error() { global $RCMAIL; diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc index 202578676..f34e3c550 100644 --- a/program/steps/settings/edit_folder.inc +++ b/program/steps/settings/edit_folder.inc @@ -298,6 +298,8 @@ function rcmail_folder_form($attrib) function rcmail_get_form_part($form, $attrib = array()) { + global $RCMAIL; + $content = ''; if (is_array($form['content']) && !empty($form['content'])) { diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc index 10dec1096..03a6878be 100644 --- a/program/steps/settings/edit_response.inc +++ b/program/steps/settings/edit_response.inc @@ -79,7 +79,7 @@ $OUTPUT->send('responseedit'); function rcube_response_form($attrib) { - global $RCMAIL, $OUTPUT, $RESPONSE_RECORD; + global $RCMAIL, $RESPONSE_RECORD; // Set form tags and hidden fields $disabled = !empty($RESPONSE_RECORD['static']); @@ -91,7 +91,6 @@ function rcube_response_form($attrib) $out = "$form_start\n"; $table = new html_table(array('cols' => 2)); - $label = $RCMAIL->gettext('responsename'); $table->add('title', html::label('ffname', rcube::Q($RCMAIL->gettext('responsename')))); $table->add(null, rcube_output::get_edit_field('name', $RESPONSE_RECORD['name'], diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 14e41d607..6db0b17e8 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -269,7 +269,6 @@ function rcmail_subscription_form($attrib) // create list of available folders foreach ($list_folders as $i => $folder) { - $idx = $i + 1; $sub_key = array_search($folder['id'], $a_subscribed); $subscribed = $sub_key !== false; $protected = $protect_default && isset($special_folders[$folder['id']]); diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 0b2039a78..3ec318566 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -890,7 +890,7 @@ function rcmail_user_prefs($current = null) $select_default_font->add('', ''); $fonts = rcmail::font_defs(); - foreach ($fonts as $fname => $font) { + foreach (array_keys($fonts) as $fname) { $select_default_font->add($fname, $fname); } @@ -1360,7 +1360,7 @@ function rcmail_settings_tabs($attrib) $tagname = $attrib['tagname']; $tabs = array(); - foreach ($plugin['actions'] as $k => $action) { + foreach ($plugin['actions'] as $action) { if (!$action['command'] && !$action['href'] && $action['action']) { $action['href'] = $RCMAIL->url(array('_action' => $action['action'])); } diff --git a/skins/classic/common.css b/skins/classic/common.css index b87286249..03494496d 100644 --- a/skins/classic/common.css +++ b/skins/classic/common.css @@ -1458,7 +1458,11 @@ table.quota-info td.root { padding: 6px 8px !important; } -.mce-tinymce, +.mce-tinymce +{ + border-radius: 0 !important; +{ + .mce-panel.mce-toolbar-grp { border: 0 !important; diff --git a/skins/classic/mail.css b/skins/classic/mail.css index 1eeba491a..b10e9952f 100644 --- a/skins/classic/mail.css +++ b/skins/classic/mail.css @@ -1381,6 +1381,10 @@ div.hide-headers border: 1px solid #999; } +#compose-body-div .mce-tinymce { + border: 0 !important; +} + #compose-div .boxlistcontent { bottom: 23px; diff --git a/skins/larry/ui.js b/skins/larry/ui.js index c8204b603..eac9ff912 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -1138,14 +1138,11 @@ function rcube_mail_ui() */ function show_about(elem) { - var frame = $('<iframe>').attr('id', 'aboutframe') - .attr('src', rcmail.url('settings/about')) - .attr('frameborder', '0') - .appendTo(document.body); - - var h = Math.floor($(window).height() * 0.75); - var buttons = {}; - var supportln = $('#supportlink'); + var frame = $('<iframe>').attr({id: 'aboutframe', src: rcmail.url('settings/about'), frameborder: '0'}); + h = Math.floor($(window).height() * 0.75), + buttons = {}, + supportln = $('#supportlink'); + if (supportln.length && (env.supporturl = supportln.attr('href'))) buttons[supportln.html()] = function(e){ env.supporturl.indexOf('mailto:') < 0 ? window.open(env.supporturl) : location.href = env.supporturl }; diff --git a/tests/Framework/BaseReplacer.php b/tests/Framework/BaseReplacer.php index 44a9604ac..2255e9af2 100644 --- a/tests/Framework/BaseReplacer.php +++ b/tests/Framework/BaseReplacer.php @@ -31,4 +31,32 @@ class Framework_BaseReplacer extends PHPUnit_Framework_TestCase $this->assertSame('<A href="http://shouldbethislink.com">Test URL</A>', $response); } + + /** + * Data for absolute_url() test + */ + function data_absolute_url() + { + return array( + array('', 'http://test', 'http://test/'), + array('http://test', 'http://anything', 'http://test'), + array('cid:test', 'http://anything', 'cid:test'), + array('/test', 'http://test', 'http://test/test'), + array('./test', 'http://test', 'http://test/test'), + array('../test1', 'http://test/test2', 'http://test1'), + array('../test1', 'http://test/test2/', 'http://test/test1'), + ); + } + + /** + * Test absolute_url() + * @dataProvider data_absolute_url + */ + function test_absolute_url($path, $base, $expected) + { + $replacer = new rcube_base_replacer('test'); + $result = $replacer->absolute_url($path, $base); + + $this->assertSame($expected, $result); + } } |