From 9f0ca2dca669a3f379d8582f128b7cca7056a921 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Thu, 18 Oct 2012 06:14:02 -0400
Subject: [PATCH] Merge branch 'master' of github.com:roundcube/roundcubemail

---
 plugins/managesieve/localization/et_EE.inc |    4 
 plugins/managesieve/localization/ro_RO.inc |    4 
 plugins/managesieve/localization/nb_NO.inc |    4 
 plugins/managesieve/localization/fr_FR.inc |    4 
 plugins/managesieve/localization/sl_SI.inc |    4 
 plugins/managesieve/localization/cy_GB.inc |    4 
 plugins/managesieve/localization/zh_CN.inc |    4 
 plugins/managesieve/localization/bs_BA.inc |    4 
 plugins/managesieve/localization/en_US.inc |    4 
 plugins/managesieve/localization/es_ES.inc |    4 
 plugins/managesieve/localization/fi_FI.inc |    4 
 plugins/managesieve/localization/id_ID.inc |    4 
 plugins/managesieve/localization/vi_VN.inc |    4 
 program/include/rcube_plugin.php           |    2 
 skins/classic/mail.css                     |    2 
 plugins/managesieve/localization/hr_HR.inc |    4 
 plugins/managesieve/localization/de_CH.inc |    4 
 plugins/managesieve/localization/nl_NL.inc |    4 
 program/steps/mail/func.inc                |    5 
 plugins/managesieve/localization/da_DK.inc |    4 
 plugins/managesieve/localization/he_IL.inc |    4 
 plugins/managesieve/localization/it_IT.inc |    4 
 plugins/managesieve/localization/pt_BR.inc |    4 
 plugins/managesieve/localization/ca_ES.inc |    4 
 plugins/managesieve/localization/ml_IN.inc |    4 
 CHANGELOG                                  |    3 
 plugins/managesieve/localization/zh_TW.inc |    4 
 program/include/html.php                   |    2 
 plugins/managesieve/localization/pl_PL.inc |    4 
 plugins/managesieve/localization/tr_TR.inc |    4 
 program/include/rcube_plugin_api.php       |   24 ++--
 plugins/managesieve/localization/cs_CZ.inc |    4 
 plugins/managesieve/localization/hy_AM.inc |    4 
 plugins/managesieve/localization/hu_HU.inc |    4 
 program/include/rcube_string_replacer.php  |   30 ++++-
 plugins/managesieve/localization/ru_RU.inc |    4 
 plugins/managesieve/localization/sk_SK.inc |    4 
 plugins/managesieve/localization/pt_PT.inc |    4 
 plugins/managesieve/Changelog              |    2 
 plugins/managesieve/localization/fa_IR.inc |    4 
 tests/Framework/StringReplacer.php         |   24 ++++
 config/main.inc.php.dist                   |    8 
 program/include/rcube_message.php          |    5 
 program/include/rcube_output.php           |    2 
 plugins/managesieve/localization/ko_KR.inc |    4 
 program/include/rcmail.php                 |   23 +---
 plugins/managesieve/localization/sv_SE.inc |    4 
 plugins/managesieve/localization/ja_JP.inc |    4 
 48 files changed, 152 insertions(+), 120 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index ee5e174..b3c33b3 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,9 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Fix handling of URLs with asterisk characters (#1488759)
+- Remove automatic to-lowercase conversion of usernames (#1488715)
+- Fix scrolling quirk in email preview frame using Opera 12 (#1488763)
 - Fix displaying of multipart/alternative messages with empty parts (#1488750)
 - Fix threaded list sorting on PHP < 5.2.9 (#1488748)
 - Plugin API: Add 'email_list' argument for identities data in user_create hook
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index a6661c3..371ccaf 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -226,10 +226,10 @@
 
 // Forces conversion of logins to lower case.
 // 0 - disabled, 1 - only domain part, 2 - domain and local part.
-// If users authentication is not case-sensitive this must be enabled.
-// After enabling it all user records need to be updated, e.g. with query:
-// UPDATE users SET username = LOWER(username);
-$rcmail_config['login_lc'] = 0;
+// If users authentication is case-insensitive this must be enabled.
+// Note: After enabling it all user records need to be updated, e.g. with query:
+//       UPDATE users SET username = LOWER(username);
+$rcmail_config['login_lc'] = 2;
 
 // Includes should be interpreted as PHP files
 $rcmail_config['skin_include_php'] = false;
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index ce93861..dceac76 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,3 +1,5 @@
+- Fixed filter activation/deactivation confirmation message (#1488765)
+
 * version 6.0 [2012-10-03]
 -----------------------------------------------------------
 - Fixed issue with DBMail bug [http://pear.php.net/bugs/bug.php?id=19077] (#1488594)
diff --git a/plugins/managesieve/localization/bs_BA.inc b/plugins/managesieve/localization/bs_BA.inc
index 438d99e..106fe6d 100644
--- a/plugins/managesieve/localization/bs_BA.inc
+++ b/plugins/managesieve/localization/bs_BA.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Set filtera je uspješno kreiran.';
 $labels['activateerror'] = 'Nije moguće omogućiti označene filtere. Desila se serverska greška.';
 $labels['deactivateerror'] = 'Nije moguće onemogućiti označene filtere. Desila se serverska greška.';
-$labels['activated'] = 'Filteri su uspješno onemogućeni.';
-$labels['deactivated'] = 'Filteri su uspješno omogućeni.';
+$labels['deactivated'] = 'Filteri su uspješno onemogućeni.';
+$labels['activated'] = 'Filteri su uspješno omogućeni.';
 $labels['moved'] = 'Filteri su uspješno premješteni.';
 $labels['moveerror'] = 'Nije moguće premjestiti označeni filter. Desila se serverska greška.';
 $labels['nametoolong'] = 'Ime je predugo.';
diff --git a/plugins/managesieve/localization/ca_ES.inc b/plugins/managesieve/localization/ca_ES.inc
index d7e8b67..ad03bdf 100644
--- a/plugins/managesieve/localization/ca_ES.inc
+++ b/plugins/managesieve/localization/ca_ES.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'S\'ha creat correctament el conjunt de filtres.';
 $labels['activateerror'] = 'No s\'ha pogut habilitar el(s) filtre(s) seleccionat(s). Hi ha hagut un error al servidor.';
 $labels['deactivateerror'] = 'No s\'ha pogut deshabilitar el(s) filtre(s) seleccionat(s). Hi ha hagut un error al servidor.';
-$labels['activated'] = 'Filtre(s) deshabilitat(s) correctament.';
-$labels['deactivated'] = 'Filtre(s) habilitat(s) correctament.';
+$labels['deactivated'] = 'Filtre(s) deshabilitat(s) correctament.';
+$labels['activated'] = 'Filtre(s) habilitat(s) correctament.';
 $labels['moved'] = 'S\'ha mogut correctament el filtre.';
 $labels['moveerror'] = 'No s\'ha pogut moure el filtre seleccionat. Hi ha hagut un error al servidor.';
 $labels['nametoolong'] = 'El nom és massa llarg.';
diff --git a/plugins/managesieve/localization/cs_CZ.inc b/plugins/managesieve/localization/cs_CZ.inc
index 0790eae..c3448ab 100644
--- a/plugins/managesieve/localization/cs_CZ.inc
+++ b/plugins/managesieve/localization/cs_CZ.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Sada filtrů úspěšně vytvořena.';
 $labels['activateerror'] = 'Nelze zapnout vybrané filtr/y. Došlo k chybě serveru.';
 $labels['deactivateerror'] = 'Nelze vypnout vybrané filtr/y. Došlo k chybě serveru.';
-$labels['activated'] = 'Filtr/y úspěšne vypnuty.';
-$labels['deactivated'] = 'Filtr/y úspěšně zapnuty.';
+$labels['deactivated'] = 'Filtr/y úspěšne vypnuty.';
+$labels['activated'] = 'Filtr/y úspěšně zapnuty.';
 $labels['moved'] = 'Filtr byl úspěšně přesunut.';
 $labels['moveerror'] = 'Nelze přesunout vybraný filtr. Došlo k chybě na serveru.';
 $labels['nametoolong'] = 'Příliš dlouhý název.';
diff --git a/plugins/managesieve/localization/cy_GB.inc b/plugins/managesieve/localization/cy_GB.inc
index bace9be..4ca1efd 100644
--- a/plugins/managesieve/localization/cy_GB.inc
+++ b/plugins/managesieve/localization/cy_GB.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Crëuwyd y set hidlydd yn llwyddiannus.';
 $labels['activateerror'] = 'Methwyd galluogi y hidlydd(ion) dewiswyd. Cafwyd gwall gweinydd.';
 $labels['deactivateerror'] = 'Methwyd analluogi y hidlydd(ion) dewiswyd. Cafwyd gwall gweinydd.';
-$labels['activated'] = 'Analluogwyd y hidlydd(ion) yn llwyddiannus.';
-$labels['deactivated'] = 'Galluogwyd y hidlydd(ion) yn llwyddiannus.';
+$labels['deactivated'] = 'Analluogwyd y hidlydd(ion) yn llwyddiannus.';
+$labels['activated'] = 'Galluogwyd y hidlydd(ion) yn llwyddiannus.';
 $labels['moved'] = 'Symudwyd y hidlydd yn llwyddiannus.';
 $labels['moveerror'] = 'Methwyd symud y hidlydd dewiswyd. Cafwyd gwall gweinydd.';
 $labels['nametoolong'] = 'Enw yn rhy hir.';
diff --git a/plugins/managesieve/localization/da_DK.inc b/plugins/managesieve/localization/da_DK.inc
index 91bc18d..8c96a14 100644
--- a/plugins/managesieve/localization/da_DK.inc
+++ b/plugins/managesieve/localization/da_DK.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Filter sæt oprettet.';
 $labels['activateerror'] = 'Kan ikek aktivere valgt filter sæt. Server fejl.';
 $labels['deactivateerror'] = 'Kan ikke deaktivere valgt filter sæt. Server fejl.';
-$labels['activated'] = 'Filter(filtre) deaktiveret.';
-$labels['deactivated'] = 'Filter(filtre) aktiveret.';
+$labels['deactivated'] = 'Filter(filtre) deaktiveret.';
+$labels['activated'] = 'Filter(filtre) aktiveret.';
 $labels['moved'] = 'Filter flyttet.';
 $labels['moveerror'] = 'Kan ikke flytte valgt filter. Server fejl.';
 $labels['nametoolong'] = 'Navn er for langt.';
diff --git a/plugins/managesieve/localization/de_CH.inc b/plugins/managesieve/localization/de_CH.inc
index 963d1a6..ceb7475 100644
--- a/plugins/managesieve/localization/de_CH.inc
+++ b/plugins/managesieve/localization/de_CH.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Filter erfolgreich erstellt.';
 $labels['activateerror'] = 'Filter kann nicht aktiviert werden. Serverfehler.';
 $labels['deactivateerror'] = 'Filter kann nicht deaktiviert werden. Serverfehler.';
-$labels['activated'] = 'Filter erfolgreich deaktiviert.';
-$labels['deactivated'] = 'Filter erfolgreich aktiviert.';
+$labels['deactivated'] = 'Filter erfolgreich deaktiviert.';
+$labels['activated'] = 'Filter erfolgreich aktiviert.';
 $labels['moved'] = 'Filter erfolgreich verschoben.';
 $labels['moveerror'] = 'Filter kann nicht verschoben werden. Serverfehler.';
 $labels['nametoolong'] = 'Filtersatz kann nicht erstellt werden. Name zu lang.';
diff --git a/plugins/managesieve/localization/en_US.inc b/plugins/managesieve/localization/en_US.inc
index cb223c1..9336390 100644
--- a/plugins/managesieve/localization/en_US.inc
+++ b/plugins/managesieve/localization/en_US.inc
@@ -145,8 +145,8 @@
 $messages['setcreated'] = 'Filters set created successfully.';
 $messages['activateerror'] = 'Unable to enable selected filter(s). Server error occured.';
 $messages['deactivateerror'] = 'Unable to disable selected filter(s). Server error occured.';
-$messages['activated'] = 'Filter(s) disabled successfully.';
-$messages['deactivated'] = 'Filter(s) enabled successfully.';
+$messages['deactivated'] = 'Filter(s) disabled successfully.';
+$messages['activated'] = 'Filter(s) enabled successfully.';
 $messages['moved'] = 'Filter moved successfully.';
 $messages['moveerror'] = 'Unable to move selected filter. Server error occured.';
 $messages['nametoolong'] = 'Name too long.';
diff --git a/plugins/managesieve/localization/es_ES.inc b/plugins/managesieve/localization/es_ES.inc
index 75965ae..a171ec4 100644
--- a/plugins/managesieve/localization/es_ES.inc
+++ b/plugins/managesieve/localization/es_ES.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Conjunto de filtros creado satisfactoriamente';
 $labels['activateerror'] = 'No se ha podido habilitar el filtro(s) seleccionado. Se ha producido un error de servidor.';
 $labels['deactivateerror'] = 'No se ha podido deshabilitar el filtro(s) seleccionado. Se ha producido un error de servidor.';
-$labels['activated'] = 'Filtro(s) deshabilitado(s) correctamente.';
-$labels['deactivated'] = 'Filtro(s) habilitado(s) correctamente.';
+$labels['deactivated'] = 'Filtro(s) deshabilitado(s) correctamente.';
+$labels['activated'] = 'Filtro(s) habilitado(s) correctamente.';
 $labels['moved'] = 'Filtro movido correctamente';
 $labels['moveerror'] = 'No se ha podido mover el filtro seleccionado. Ha ocurrido un error de servidor.';
 $labels['nametoolong'] = 'Imposible crear el conjunto de filtros. Nombre demasiado largo';
diff --git a/plugins/managesieve/localization/et_EE.inc b/plugins/managesieve/localization/et_EE.inc
index fab9663..67501f8 100644
--- a/plugins/managesieve/localization/et_EE.inc
+++ b/plugins/managesieve/localization/et_EE.inc
@@ -130,8 +130,8 @@
 $labels['ruleexist'] = 'Määratud nimega filter on juba olemas';
 $labels['activateerror'] = 'Valitud filtrite lubamine nurjus. Ilmnes serveri tõrge.';
 $labels['deactivateerror'] = 'Valitud filtrite keelamine nurjus. Ilmnes serveri tõrge.';
-$labels['activated'] = 'Filter edukalt keelatud.';
-$labels['deactivated'] = 'Filter edukalt lubatud.';
+$labels['deactivated'] = 'Filter edukalt keelatud.';
+$labels['activated'] = 'Filter edukalt lubatud.';
 $labels['moved'] = 'Filter edukalt liigutatud.';
 $labels['moveerror'] = 'Valitud filtri liigutamine nurjus. Ilmnes serveri tõrge.';
 $labels['nametoolong'] = 'Nimi on liiga pikk.';
diff --git a/plugins/managesieve/localization/fa_IR.inc b/plugins/managesieve/localization/fa_IR.inc
index e4abb3f..9f20dab 100644
--- a/plugins/managesieve/localization/fa_IR.inc
+++ b/plugins/managesieve/localization/fa_IR.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'مجموعه صافی‌ها با موفقیت ایجاد شد.';
 $labels['activateerror'] = 'ناتوانی در فعال کردن صافی(های) انتخاب شده. خطای سرور رخ داد.';
 $labels['deactivateerror'] = 'ناتوانی در غیرفعال کردن صافی(های) انتخاب شده. خطای سرور رخ داد.';
-$labels['activated'] = 'صافی(ها) با موفقیت غیرفعال شدند.';
-$labels['deactivated'] = 'صافی(ها) با موفقیت فعال شدند.';
+$labels['deactivated'] = 'صافی(ها) با موفقیت غیرفعال شدند.';
+$labels['activated'] = 'صافی(ها) با موفقیت فعال شدند.';
 $labels['moved'] = 'صافی با موفقیت منتقل شد.';
 $labels['moveerror'] = 'ناتوانی در انتقال صافی انتخاب شده. خطای سرور رخ داد.';
 $labels['nametoolong'] = 'نام خیلی بلند.';
diff --git a/plugins/managesieve/localization/fi_FI.inc b/plugins/managesieve/localization/fi_FI.inc
index cee7142..5a0c309 100644
--- a/plugins/managesieve/localization/fi_FI.inc
+++ b/plugins/managesieve/localization/fi_FI.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Suodatinlistan luonti onnistui.';
 $labels['activateerror'] = 'Suodatinlistan päälle kytkeminen epäonnistui. Palvelin virhe.';
 $labels['deactivateerror'] = 'Suodatinlistan pois päältä kytkeminen epäonnistui. Palvelin virhe.';
-$labels['activated'] = 'Suodatinlista(t) kytketty pois päältä onnistuneesti.';
-$labels['deactivated'] = 'Suodatinlista(t) kytketty päälle onnistuneesti.';
+$labels['deactivated'] = 'Suodatinlista(t) kytketty pois päältä onnistuneesti.';
+$labels['activated'] = 'Suodatinlista(t) kytketty päälle onnistuneesti.';
 $labels['moved'] = 'Suodatin siirretty onnistuneesti.';
 $labels['moveerror'] = 'Valitun suodattimen siirto epäonnistui palvelinvirheen vuoksi.';
 $labels['nametoolong'] = 'Nimi on liian pitkä.';
diff --git a/plugins/managesieve/localization/fr_FR.inc b/plugins/managesieve/localization/fr_FR.inc
index 4151f63..b0a4089 100644
--- a/plugins/managesieve/localization/fr_FR.inc
+++ b/plugins/managesieve/localization/fr_FR.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Le groupe de filtres a bien été créé.';
 $labels['activateerror'] = 'Impossible d\'activer le(s) filtre(s) sélectionné(s). Une erreur serveur s\'est produite.';
 $labels['deactivateerror'] = 'Impossible de désactiver le(s) filtre(s) sélectionné(s). Une erreur serveur s\'est produite.';
-$labels['activated'] = 'Filtre(s) désactivé(s) avec succès';
-$labels['deactivated'] = 'Filtre(s) activé(s) avec succès';
+$labels['deactivated'] = 'Filtre(s) désactivé(s) avec succès';
+$labels['activated'] = 'Filtre(s) activé(s) avec succès';
 $labels['moved'] = 'Filtre déplacé avec succès.';
 $labels['moveerror'] = 'Déplacement du filtre sélectionné impossible. Le serveur a renvoyé une erreur.';
 $labels['nametoolong'] = 'Nom trop long.';
diff --git a/plugins/managesieve/localization/he_IL.inc b/plugins/managesieve/localization/he_IL.inc
index b44088b..2262841 100644
--- a/plugins/managesieve/localization/he_IL.inc
+++ b/plugins/managesieve/localization/he_IL.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'ערכת המסננים נוצרה בהצלחה.';
 $labels['activateerror'] = 'לא ניתן להפעיל את המסננים הנבחרים. אירעה שגיאה בצד השרת.';
 $labels['deactivateerror'] = 'לא ניתן לנטרל את המסננים הנבחרים. אירעה שגיאה בצד השרת.';
-$labels['activated'] = 'המסננים נוטרלו בהצלחה.';
-$labels['deactivated'] = 'המסננים הופעלו בהצלחה.';
+$labels['deactivated'] = 'המסננים נוטרלו בהצלחה.';
+$labels['activated'] = 'המסננים הופעלו בהצלחה.';
 $labels['moved'] = 'המסנן הועבר בהצלחה.';
 $labels['moveerror'] = 'לא ניתן להעביר את המסנן הנבחר. אירעה שגיאה בצד השרת.';
 $labels['nametoolong'] = 'השם ארוך מדי.';
diff --git a/plugins/managesieve/localization/hr_HR.inc b/plugins/managesieve/localization/hr_HR.inc
index c4eaec0..4e02118 100644
--- a/plugins/managesieve/localization/hr_HR.inc
+++ b/plugins/managesieve/localization/hr_HR.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Grupa filtera je uspješno stvorena';
 $labels['activateerror'] = 'Nije moguće omogućiti odabrani filter(e). Greška poslužitelja.';
 $labels['deactivateerror'] = 'Nije moguće onemogučiti odabrane filter(e). Greška poslužitelja.';
-$labels['activated'] = 'Filter(i) onemogućen(i) uspješno.';
-$labels['deactivated'] = 'Filter(i) omogućen(i) uspješno.';
+$labels['deactivated'] = 'Filter(i) onemogućen(i) uspješno.';
+$labels['activated'] = 'Filter(i) omogućen(i) uspješno.';
 $labels['moved'] = 'Filter uspješno premješten.';
 $labels['moveerror'] = 'Nije moguće premjestiti odabrani filter. Greška poslužitelja.';
 $labels['nametoolong'] = 'Nemoguće napraviti grupu filtera. Naziv je predugačak';
diff --git a/plugins/managesieve/localization/hu_HU.inc b/plugins/managesieve/localization/hu_HU.inc
index 1173158..1795100 100644
--- a/plugins/managesieve/localization/hu_HU.inc
+++ b/plugins/managesieve/localization/hu_HU.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'A szűrő készlet sikeresen létrejött.';
 $labels['activateerror'] = 'Nem sikerült engedélyezni a kiválasztott szűrö(k)et. Szerver hiba történt.';
 $labels['deactivateerror'] = 'Nem sikerült kikapcsolni a kiválasztott szűrő(ke)t. Szerver hiba történt.';
-$labels['activated'] = 'Szűrő(k) sikeresen kikapcsolva.';
-$labels['deactivated'] = 'Szűrő(k) sikeresen bekapcsolva.';
+$labels['deactivated'] = 'Szűrő(k) sikeresen kikapcsolva.';
+$labels['activated'] = 'Szűrő(k) sikeresen bekapcsolva.';
 $labels['moved'] = 'A szűrő sikeresen áthelyezve.';
 $labels['moveerror'] = 'Az áthelyezés nem sikerült. Szerver hiba történt.';
 $labels['nametoolong'] = 'Túll hosszu név';
diff --git a/plugins/managesieve/localization/hy_AM.inc b/plugins/managesieve/localization/hy_AM.inc
index ea4e982..be7d0fb 100644
--- a/plugins/managesieve/localization/hy_AM.inc
+++ b/plugins/managesieve/localization/hy_AM.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Զտիչների համալիրը ստեղծված է։';
 $labels['activateerror'] = 'Սերվերի սխալ։ Նշված զտիչի միացման ձախողում։';
 $labels['deactivateerror'] = 'Սերվերի սխալ։ Նշված զտիչի անջատման ձախողում։';
-$labels['activated'] = 'Զտիչի անջատված է։';
-$labels['deactivated'] = 'Զտիչի միացված է։';
+$labels['deactivated'] = 'Զտիչի անջատված է։';
+$labels['activated'] = 'Զտիչի միացված է։';
 $labels['moved'] = 'Զտիչի տեղափոխված է։';
 $labels['moveerror'] = 'Սերվերի սխալ։ Նշված զտիչի տեղափոխման ձախողում։';
 $labels['nametoolong'] = 'Անունը չափազանց երկար է։';
diff --git a/plugins/managesieve/localization/id_ID.inc b/plugins/managesieve/localization/id_ID.inc
index 1fe121a..b9fe476 100644
--- a/plugins/managesieve/localization/id_ID.inc
+++ b/plugins/managesieve/localization/id_ID.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Kumpulan penyaringan berhasul dibuat.';
 $labels['activateerror'] = 'Tidak bisa menghidupkan penyaringan terpilih. terjadi galat pada server.';
 $labels['deactivateerror'] = 'Tidak bisa mematikan penyaringan terpilih. Terjadi galat pada server.';
-$labels['activated'] = 'Berhasil mematikan penyaringan.';
-$labels['deactivated'] = 'Berhasil menghidupkan penyaringan.';
+$labels['deactivated'] = 'Berhasil mematikan penyaringan.';
+$labels['activated'] = 'Berhasil menghidupkan penyaringan.';
 $labels['moved'] = 'Berhasil memindahkan penyaringan.';
 $labels['moveerror'] = 'Tidak bisa memindahkan penyaringan terpilih. Terjadi galat pada server.';
 $labels['nametoolong'] = 'Kepanjangan nama.';
diff --git a/plugins/managesieve/localization/it_IT.inc b/plugins/managesieve/localization/it_IT.inc
index 53e7d09..553377a 100644
--- a/plugins/managesieve/localization/it_IT.inc
+++ b/plugins/managesieve/localization/it_IT.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Gruppo di filtri creato';
 $labels['activateerror'] = 'impossibile selezionare il filtro (server error)';
 $labels['deactivateerror'] = 'impossibile disabilitare il filtro (server error)';
-$labels['activated'] = 'filtro disabilitato';
-$labels['deactivated'] = 'filtro abilitato';
+$labels['deactivated'] = 'filtro disabilitato';
+$labels['activated'] = 'filtro abilitato';
 $labels['moved'] = 'filtro spostato';
 $labels['moveerror'] = 'impossibile spostare il filtro (server error)';
 $labels['nametoolong'] = 'Impossibile creare il gruppo: Nome troppo lungo';
diff --git a/plugins/managesieve/localization/ja_JP.inc b/plugins/managesieve/localization/ja_JP.inc
index f7b96b7..5bb75f8 100644
--- a/plugins/managesieve/localization/ja_JP.inc
+++ b/plugins/managesieve/localization/ja_JP.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'フィルターセットを作成しました。';
 $labels['activateerror'] = '選択したフィルターを有効にできませんでした。サーバーでエラーが発生しました。';
 $labels['deactivateerror'] = '選択したフィルターを無効にできませんでした。サーバーでエラーが発生しました。';
-$labels['activated'] = 'フィルターを無効にしました。';
-$labels['deactivated'] = 'フィルターを有効にしました。';
+$labels['deactivated'] = 'フィルターを無効にしました。';
+$labels['activated'] = 'フィルターを有効にしました。';
 $labels['moved'] = 'フィルターを移動しました。';
 $labels['moveerror'] = '選択したフィルターを移動できませんでした。サーバーでエラーが発生しました。';
 $labels['nametoolong'] = '名前が長すぎます。';
diff --git a/plugins/managesieve/localization/ko_KR.inc b/plugins/managesieve/localization/ko_KR.inc
index c3fff41..8a20a17 100644
--- a/plugins/managesieve/localization/ko_KR.inc
+++ b/plugins/managesieve/localization/ko_KR.inc
@@ -120,8 +120,8 @@
 $labels['setcreated'] = '필터 묶음을 성공적으로 생성 함.';
 $labels['activateerror'] = '선택한 필터(들)을 동작하게 할 수 없음. 서버 에러 발생 함.';
 $labels['deactivateerror'] = '선택한 필터(들)을 동작하지 않게 할 수 없음. 서버 에러 발생 함.';
-$labels['activated'] = '필터(들)을 동작하지 않게 하는데 성공하였음.';
-$labels['deactivated'] = '필터(들)을 동작하게 하는데 성공하였음.';
+$labels['deactivated'] = '필터(들)을 동작하지 않게 하는데 성공하였음.';
+$labels['activated'] = '필터(들)을 동작하게 하는데 성공하였음.';
 $labels['moved'] = '필터를 이동하는 데 성공하였음.';
 $labels['moveerror'] = '선택한 필터를 이동할 수 없음. 서버 에러 발생 함.';
 $labels['nametoolong'] = '이름이 너무 김.';
diff --git a/plugins/managesieve/localization/ml_IN.inc b/plugins/managesieve/localization/ml_IN.inc
index ed3d767..012278e 100644
--- a/plugins/managesieve/localization/ml_IN.inc
+++ b/plugins/managesieve/localization/ml_IN.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'അരിപ്പകളുടെ കൂട്ടത്തെ വിജയകരമായി നിര്‍മ്മിച്ചു.';
 $labels['activateerror'] = 'അരിപ്പ (കള്‍) പ്രവര്‍ത്തനസജ്ജം ആക്കാന്‍ സാധിച്ചില്ല. സേവകനില്‍ കുഴപ്പം!';
 $labels['deactivateerror'] = 'അരിപ്പ (കള്‍) നിര്‍വീര്യം ആക്കാന്‍ സാധിച്ചില്ല. സേവകനില്‍ കുഴപ്പം!';
-$labels['activated'] = 'അരിപ്പകള്‍ നിര്‍വീര്യം ആക്കപ്പെട്ടിരിക്കുന്നു';
-$labels['deactivated'] = 'അരിപ്പ വിജകരമായി പ്രവര്‍ത്തനസജ്ജമാക്കി.';
+$labels['deactivated'] = 'അരിപ്പകള്‍ നിര്‍വീര്യം ആക്കപ്പെട്ടിരിക്കുന്നു';
+$labels['activated'] = 'അരിപ്പ വിജകരമായി പ്രവര്‍ത്തനസജ്ജമാക്കി.';
 $labels['moved'] = 'അരിപ്പ വിജകരമായി മാറ്റി.';
 $labels['moveerror'] = 'തെരഞ്ഞെടുത്ത അരിപ്പ മാറ്റാന്‍ സാധിച്ചില്ല. സേവകനില്‍ കുഴപ്പം.';
 $labels['nametoolong'] = 'പേരിന് നീളം കൂടുതല്‍.';
diff --git a/plugins/managesieve/localization/nb_NO.inc b/plugins/managesieve/localization/nb_NO.inc
index b172685..ee6d578 100644
--- a/plugins/managesieve/localization/nb_NO.inc
+++ b/plugins/managesieve/localization/nb_NO.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Filtersett opprettet.';
 $labels['activateerror'] = 'Kunne ikke skru på valgte filter. Det oppsto en tjenerfeil.';
 $labels['deactivateerror'] = 'Kunne ikke skru av valgte filter. Det oppsto en tjenerfeil.';
-$labels['activated'] = 'Filter skrudd av.';
-$labels['deactivated'] = 'Filter ble skrudd på.';
+$labels['deactivated'] = 'Filter skrudd av.';
+$labels['activated'] = 'Filter ble skrudd på.';
 $labels['moved'] = 'Filter ble flyttet.';
 $labels['moveerror'] = 'Kunne ikke flytte valgte filter. Det oppsto en tjenerfeil.';
 $labels['nametoolong'] = 'Navnet er for langt.';
diff --git a/plugins/managesieve/localization/nl_NL.inc b/plugins/managesieve/localization/nl_NL.inc
index 8ee5e2b..56b1c95 100644
--- a/plugins/managesieve/localization/nl_NL.inc
+++ b/plugins/managesieve/localization/nl_NL.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Filterverzameling succesvol aangemaakt.';
 $labels['activateerror'] = 'Geselecteerde filter(s) konden niet ingeschakeld worden. Er trad een serverfout op.';
 $labels['deactivateerror'] = 'Geselecteerde filter(s) konden niet uitgeschakeld worden. Er trad een serverfout op.';
-$labels['activated'] = 'Filter(s) succesvol uitgeschakeld.';
-$labels['deactivated'] = 'Filter(s) succesvol ingeschakeld.';
+$labels['deactivated'] = 'Filter(s) succesvol uitgeschakeld.';
+$labels['activated'] = 'Filter(s) succesvol ingeschakeld.';
 $labels['moved'] = 'Filter succesvol verplaatst.';
 $labels['moveerror'] = 'Geselecteerde filter(s) konden niet verplaatst worden. Er trad een serverfout op.';
 $labels['nametoolong'] = 'Naam is te lang.';
diff --git a/plugins/managesieve/localization/pl_PL.inc b/plugins/managesieve/localization/pl_PL.inc
index 734a4eb..e078f49 100644
--- a/plugins/managesieve/localization/pl_PL.inc
+++ b/plugins/managesieve/localization/pl_PL.inc
@@ -158,8 +158,8 @@
 $labels['setcreated'] = 'Zbiór filtrów został utworzony pomyślnie.';
 $labels['activateerror'] = 'Nie można włączyć wybranych filtrów. Błąd serwera.';
 $labels['deactivateerror'] = 'Nie można wyłączyć wybranych filtrów. Błąd serwera.';
-$labels['activated'] = 'Filtr(y) wyłączono pomyślnie.';
-$labels['deactivated'] = 'Filtr(y) włączono pomyślnie.';
+$labels['deactivated'] = 'Filtr(y) wyłączono pomyślnie.';
+$labels['activated'] = 'Filtr(y) włączono pomyślnie.';
 $labels['moved'] = 'Filter został przeniesiony pomyślnie.';
 $labels['moveerror'] = 'Nie można przenieść wybranego filtra. Błąd serwera.';
 $labels['nametoolong'] = 'Zbyt długa nazwa.';
diff --git a/plugins/managesieve/localization/pt_BR.inc b/plugins/managesieve/localization/pt_BR.inc
index f0e890d..f4b6458 100644
--- a/plugins/managesieve/localization/pt_BR.inc
+++ b/plugins/managesieve/localization/pt_BR.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Conjunto de filtros criado com sucesso.';
 $labels['activateerror'] = 'Não foi possível habilitar o(s) filtro(s) selecionado(s). Ocorreu um erro no servidor.';
 $labels['deactivateerror'] = 'Não foi possível desabilitar o(s) filtro(s) selecionado(s). Ocorreu um erro no servidor.';
-$labels['activated'] = 'Filtro(s) desabilitado(s) com sucesso.';
-$labels['deactivated'] = 'Filtro(s) habilitado(s) com sucesso.';
+$labels['deactivated'] = 'Filtro(s) desabilitado(s) com sucesso.';
+$labels['activated'] = 'Filtro(s) habilitado(s) com sucesso.';
 $labels['moved'] = 'Filtro movido com sucesso.';
 $labels['moveerror'] = 'Não foi possível mover o filtro selecionado. Ocorreu um erro no servidor.';
 $labels['nametoolong'] = 'Nome muito longo.';
diff --git a/plugins/managesieve/localization/pt_PT.inc b/plugins/managesieve/localization/pt_PT.inc
index bb0c781..8a0a1da 100644
--- a/plugins/managesieve/localization/pt_PT.inc
+++ b/plugins/managesieve/localization/pt_PT.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Conjunto de filtros criado com sucesso.';
 $labels['activateerror'] = 'Não foi possível ativar os filtros selecionados. Ocorreu um erro no servidor.';
 $labels['deactivateerror'] = 'Não foi possível desativar os filtros selecionados. Ocorreu um erro no servidor.';
-$labels['activated'] = 'Filtro(s) desativado(s) com sucesso.';
-$labels['deactivated'] = 'Filtro(s) ativado(s) com sucesso.';
+$labels['deactivated'] = 'Filtro(s) desativado(s) com sucesso.';
+$labels['activated'] = 'Filtro(s) ativado(s) com sucesso.';
 $labels['moved'] = 'Filtro movido com sucesso.';
 $labels['moveerror'] = 'Não foi possível mover o filtro selecionado. Ocorreu um erro no servidor.';
 $labels['nametoolong'] = 'Nome demasiado longo.';
diff --git a/plugins/managesieve/localization/ro_RO.inc b/plugins/managesieve/localization/ro_RO.inc
index 755ee03..8889852 100644
--- a/plugins/managesieve/localization/ro_RO.inc
+++ b/plugins/managesieve/localization/ro_RO.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Setul de filtre creat cu succes.';
 $labels['activateerror'] = 'Nu am putut activa filtrele selectate. S-a produs o eroare la server.';
 $labels['deactivateerror'] = 'Nu am putut dezactiva filtrele selectate. S-a produs o eroare la server.';
-$labels['activated'] = 'Filtrele au fost dezactivate cu succes.';
-$labels['deactivated'] = 'Filtrele au fost activate cu succes.';
+$labels['deactivated'] = 'Filtrele au fost dezactivate cu succes.';
+$labels['activated'] = 'Filtrele au fost activate cu succes.';
 $labels['moved'] = 'Filtrele au fost mutate cu succes.';
 $labels['moveerror'] = 'Nu am putut muta filtreele selectate. S-a produs o eroare la server.';
 $labels['nametoolong'] = 'Numele este prea lung.';
diff --git a/plugins/managesieve/localization/ru_RU.inc b/plugins/managesieve/localization/ru_RU.inc
index cfc2ac1..0689bd8 100644
--- a/plugins/managesieve/localization/ru_RU.inc
+++ b/plugins/managesieve/localization/ru_RU.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Набор фильтров успешно создан.';
 $labels['activateerror'] = 'Невозможно включить выбранный(е) фильтр(ы). Ошибка сервера.';
 $labels['deactivateerror'] = 'Невозможно выключить выбранный(е) фильтр(ы). Ошибка сервера.';
-$labels['activated'] = 'Фильтр(ы) успешно отключен(ы).';
-$labels['deactivated'] = 'Фильтр(ы) успешно включен(ы).';
+$labels['deactivated'] = 'Фильтр(ы) успешно отключен(ы).';
+$labels['activated'] = 'Фильтр(ы) успешно включен(ы).';
 $labels['moved'] = 'Фильтр успешно перемещён.';
 $labels['moveerror'] = 'Невозможно переместить фильтр. Ошибка сервера.';
 $labels['nametoolong'] = 'Невозможно создать набор фильтров. Название слишком длинное.';
diff --git a/plugins/managesieve/localization/sk_SK.inc b/plugins/managesieve/localization/sk_SK.inc
index 7d78c7f..337dfa6 100644
--- a/plugins/managesieve/localization/sk_SK.inc
+++ b/plugins/managesieve/localization/sk_SK.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Sada filtrov bola vytvorená';
 $labels['activateerror'] = 'Nepodarilo sa povoliť vybraný filter(e). Chyba servera.';
 $labels['deactivateerror'] = 'Nepodarilo sa vypnúť vybraný filter(e). Chyba servera.';
-$labels['activated'] = 'Filter(e) úspešne vypnutý.';
-$labels['deactivated'] = 'Filter(e) povolený.';
+$labels['deactivated'] = 'Filter(e) úspešne vypnutý.';
+$labels['activated'] = 'Filter(e) povolený.';
 $labels['moved'] = 'Filter presunutý.';
 $labels['moveerror'] = 'Nemôžem presunúť zvolený filter. Chyba servera.';
 $labels['nametoolong'] = 'Názov sady filtrov je príliš dlhý';
diff --git a/plugins/managesieve/localization/sl_SI.inc b/plugins/managesieve/localization/sl_SI.inc
index a0b61e7..f295225 100644
--- a/plugins/managesieve/localization/sl_SI.inc
+++ b/plugins/managesieve/localization/sl_SI.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Filter je bil uspešno ustvarjen.';
 $labels['activateerror'] = 'Izbranega/ih filtra/ov ni bilo mogoče vključiti. Prišlo je do napake na strežniku.';
 $labels['deactivateerror'] = 'Izbranega/ih fitra/ov ni bilo mogoče izključiti. Prišlo je do napake na strežniku.';
-$labels['activated'] = 'Filtri so bili uspešno onemogočeni.';
-$labels['deactivated'] = 'Filtri so bili uspešno omogočeni.';
+$labels['deactivated'] = 'Filtri so bili uspešno onemogočeni.';
+$labels['activated'] = 'Filtri so bili uspešno omogočeni.';
 $labels['moved'] = 'Filter je bil uspešno premaknjen.';
 $labels['moveerror'] = 'Izbranega filtra ni bilo mogoče premakniti. Prišlo je do napake na strežniku.';
 $labels['nametoolong'] = 'Ime je predolgo.';
diff --git a/plugins/managesieve/localization/sv_SE.inc b/plugins/managesieve/localization/sv_SE.inc
index 0dc8ce8..d7c1c76 100644
--- a/plugins/managesieve/localization/sv_SE.inc
+++ b/plugins/managesieve/localization/sv_SE.inc
@@ -139,8 +139,8 @@
 $labels['setcreated'] = 'Filtergruppen har lagts till';
 $labels['activateerror'] = 'Kunde inte aktivera filter på grund av serverfel.';
 $labels['deactivateerror'] = 'Kunde inte deaktivera filter på grund av serverfel.';
-$labels['activated'] = 'Filter deaktiverat.';
-$labels['deactivated'] = 'Filter aktiverat.';
+$labels['deactivated'] = 'Filter deaktiverat.';
+$labels['activated'] = 'Filter aktiverat.';
 $labels['moved'] = 'Filter flyttat.';
 $labels['moveerror'] = 'Kunde inte flytta filter på grund av serverfel.';
 $labels['nametoolong'] = 'Filtergruppen kan inte läggas till med för långt namn';
diff --git a/plugins/managesieve/localization/tr_TR.inc b/plugins/managesieve/localization/tr_TR.inc
index 14dd44b..9c3eb7e 100644
--- a/plugins/managesieve/localization/tr_TR.inc
+++ b/plugins/managesieve/localization/tr_TR.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Filtre setleri başarıyla oluşturuldu.';
 $labels['activateerror'] = 'Seçilen filtre(ler) etkinleştirilemedi. Sunucuda hata oluştu.';
 $labels['deactivateerror'] = 'Seçilen filtre(ler) pasifleştirilemedi. Sunucuda hata oluştu.';
-$labels['activated'] = 'Filtre(ler) başarıyla iptal edildi.';
-$labels['deactivated'] = 'Filtre(ler) başarıyla etkinleştirildi.';
+$labels['deactivated'] = 'Filtre(ler) başarıyla iptal edildi.';
+$labels['activated'] = 'Filtre(ler) başarıyla etkinleştirildi.';
 $labels['moved'] = 'Filtre başarıyla taşındı.';
 $labels['moveerror'] = 'Seçilen filtre(ler) taşınamadı. Sunucuda hata oluştu.';
 $labels['nametoolong'] = 'İsim çok uzun.';
diff --git a/plugins/managesieve/localization/vi_VN.inc b/plugins/managesieve/localization/vi_VN.inc
index d358960..14e098d 100644
--- a/plugins/managesieve/localization/vi_VN.inc
+++ b/plugins/managesieve/localization/vi_VN.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = 'Thiết lập bộ lọc được tạo thành công';
 $labels['activateerror'] = 'Không thể khởi động bộ lọc được chọn. Có lỗi xuất hiện ở máy chủ';
 $labels['deactivateerror'] = 'Không thể tắt bộ lọc đã chọn. Có lỗi xuất hiện ở máy chủ';
-$labels['activated'] = 'Bộ lọc được tắt thành công';
-$labels['deactivated'] = 'Bộ lọc được khởi động thành công';
+$labels['deactivated'] = 'Bộ lọc được tắt thành công';
+$labels['activated'] = 'Bộ lọc được khởi động thành công';
 $labels['moved'] = 'Bộ lọc được chuyển đi thành công';
 $labels['moveerror'] = 'Không thể chuyển bộc lọc đã chọn. Có lỗi xuất hiện ở máy chủ';
 $labels['nametoolong'] = 'Tên quá dài';
diff --git a/plugins/managesieve/localization/zh_CN.inc b/plugins/managesieve/localization/zh_CN.inc
index 8cbe487..e44fe07 100644
--- a/plugins/managesieve/localization/zh_CN.inc
+++ b/plugins/managesieve/localization/zh_CN.inc
@@ -138,8 +138,8 @@
 $labels['setcreated'] = '过滤器成功创建。';
 $labels['activateerror'] = '无法启用选中的过滤器,因为服务器发生错误。';
 $labels['deactivateerror'] = '无法禁用选中的过滤器,因为服务器发生错误。';
-$labels['activated'] = '禁用过滤器成功。';
-$labels['deactivated'] = '启用过滤器成功。';
+$labels['deactivated'] = '禁用过滤器成功。';
+$labels['activated'] = '启用过滤器成功。';
 $labels['moved'] = '过滤器移动成功。';
 $labels['moveerror'] = '无法移动选中的过滤器,因为服务器发生错误。';
 $labels['nametoolong'] = '名称太长。';
diff --git a/plugins/managesieve/localization/zh_TW.inc b/plugins/managesieve/localization/zh_TW.inc
index db2292b..4899d16 100644
--- a/plugins/managesieve/localization/zh_TW.inc
+++ b/plugins/managesieve/localization/zh_TW.inc
@@ -126,8 +126,8 @@
 $labels['setcreated'] = '篩選器集合成功建立';
 $labels['activateerror'] = '無法啟用選擇的篩選器。伺服器錯誤';
 $labels['deactivateerror'] = '無法停用選擇的篩選器。伺服器錯誤';
-$labels['activated'] = '篩選器已停用';
-$labels['deactivated'] = '篩選器已啟用';
+$labels['deactivated'] = '篩選器已停用';
+$labels['activated'] = '篩選器已啟用';
 $labels['moved'] = '篩選器已移動';
 $labels['moveerror'] = '無法移動選擇的篩選器。伺服器錯誤';
 $labels['nametoolong'] = '無法建立篩選器集合。 名稱太長';
diff --git a/program/include/html.php b/program/include/html.php
index 2349852..880873d 100644
--- a/program/include/html.php
+++ b/program/include/html.php
@@ -334,7 +334,7 @@
      */
     public static function quote($str)
     {
-        return htmlspecialchars($str, ENT_COMPAT, RCMAIL_CHARSET);
+        return @htmlspecialchars($str, ENT_COMPAT, RCMAIL_CHARSET);
     }
 }
 
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 3b6c6cf..7a49095 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -452,6 +452,10 @@
         $username .= '@'.rcube_utils::parse_host($config['username_domain'], $host);
     }
 
+    if (!isset($config['login_lc'])) {
+      $config['login_lc'] = 2; // default
+    }
+
     // Convert username to lowercase. If storage backend
     // is case-insensitive we need to store always the same username (#1487113)
     if ($config['login_lc']) {
@@ -483,21 +487,7 @@
     $storage = $this->get_storage();
 
     // try to log in
-    if (!($login = $storage->connect($host, $username, $pass, $port, $ssl))) {
-      // try with lowercase
-      $username_lc = mb_strtolower($username);
-      if ($username_lc != $username) {
-        // try to find user record again -> overwrite username
-        if (!$user && ($user = rcube_user::query($username_lc, $host)))
-          $username_lc = $user->data['username'];
-
-        if ($login = $storage->connect($host, $username_lc, $pass, $port, $ssl))
-          $username = $username_lc;
-      }
-    }
-
-    // exit if login failed
-    if (!$login) {
+    if (!$storage->connect($host, $username, $pass, $port, $ssl)) {
       return false;
     }
 
@@ -2117,10 +2107,9 @@
             }
             else {
                 $this->set_storage_prop();
-                return $storage->is_connected();
             }
         }
 
-        return false;
+        return $storage->is_connected();
     }
 }
diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php
index 7bf95d1..4e1b5a0 100644
--- a/program/include/rcube_message.php
+++ b/program/include/rcube_message.php
@@ -371,9 +371,10 @@
             foreach ($structure->parts as $p => $sub_part) {
                 $sub_mimetype = $sub_part->mimetype;
 
-                // skip empty parts
-                if (!$sub_part->size)
+                // skip empty text parts
+                if (!$sub_part->size && preg_match('#^text/(plain|html|enriched)$#', $sub_mimetype)) {
                     continue;
+                }
 
                 // check if sub part is
                 if ($sub_mimetype == 'text/plain')
diff --git a/program/include/rcube_output.php b/program/include/rcube_output.php
index 9aa7c9e..5c582e6 100644
--- a/program/include/rcube_output.php
+++ b/program/include/rcube_output.php
@@ -44,7 +44,7 @@
      */
     public function __construct($task = null, $framed = false)
     {
-        $this->app     = rcmail::get_instance();
+        $this->app     = rcube::get_instance();
         $this->config  = $this->app->config;
         $this->browser = new rcube_browser();
     }
diff --git a/program/include/rcube_plugin.php b/program/include/rcube_plugin.php
index c103573..4508885 100644
--- a/program/include/rcube_plugin.php
+++ b/program/include/rcube_plugin.php
@@ -202,7 +202,7 @@
       foreach ($texts as $key => $value)
         $add[$domain.'.'.$key] = $value;
 
-      $rcmail = rcmail::get_instance();
+      $rcmail = rcube::get_instance();
       $rcmail->load_language($lang, $add);
 
       // add labels to client
diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php
index 9ef68ca..107c810 100644
--- a/program/include/rcube_plugin_api.php
+++ b/program/include/rcube_plugin_api.php
@@ -31,7 +31,7 @@
  */
 class rcube_plugin_api
 {
-  static private $instance;
+  static protected $instance;
 
   public $dir;
   public $url = 'plugins/';
@@ -39,16 +39,16 @@
   public $output;
 
   public $handlers = array();
-  private $plugins = array();
-  private $tasks = array();
-  private $actions = array();
-  private $actionmap = array();
-  private $objectsmap = array();
-  private $template_contents = array();
-  private $active_hook = false;
+  protected $plugins = array();
+  protected $tasks = array();
+  protected $actions = array();
+  protected $actionmap = array();
+  protected $objectsmap = array();
+  protected $template_contents = array();
+  protected $active_hook = false;
 
   // Deprecated names of hooks, will be removed after 0.5-stable release
-  private $deprecated_hooks = array(
+  protected $deprecated_hooks = array(
     'create_user'       => 'user_create',
     'kill_session'      => 'session_destroy',
     'upload_attachment' => 'attachment_upload',
@@ -98,7 +98,7 @@
   /**
    * Private constructor
    */
-  private function __construct()
+  protected function __construct()
   {
     $this->dir = slashify(RCMAIL_PLUGINS_DIR);
   }
@@ -470,7 +470,7 @@
    * @param array $attrib
    * @return array
    */
-  private function template_container_hook($attrib)
+  protected function template_container_hook($attrib)
   {
     $container = $attrib['name'];
     return array('content' => $attrib['content'] . $this->template_contents[$container]);
@@ -483,7 +483,7 @@
    * @param string $fn Filename
    * @return string 
    */
-  private function resource_url($fn)
+  protected function resource_url($fn)
   {
     if ($fn[0] != '/' && !preg_match('|^https?://|i', $fn))
       return $this->url . $fn;
diff --git a/program/include/rcube_string_replacer.php b/program/include/rcube_string_replacer.php
index c29f0e4..ad55dd8 100644
--- a/program/include/rcube_string_replacer.php
+++ b/program/include/rcube_string_replacer.php
@@ -37,16 +37,16 @@
   {
     // Simplified domain expression for UTF8 characters handling
     // Support unicode/punycode in top-level domain part
-    $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.([^\\x00-\\x2f\\x3b-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-z0-9]{2,})';
+    $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.([^\\x00-\\x2f\\x3b-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-zA-Z0-9]{2,})';
     $url1 = '.:;,';
-    $url2 = 'a-z0-9%=#@+?!&\\/_~\\[\\]{}-';
+    $url2 = 'a-zA-Z0-9%=#$@+?!&\\/_~\\[\\]{}\*-';
 
-    $this->link_pattern = "/([\w]+:\/\/|\Wwww\.)($utf_domain([$url1]?[$url2]+)*)/i";
+    $this->link_pattern = "/([\w]+:\/\/|\W[Ww][Ww][Ww]\.|^[Ww][Ww][Ww]\.)($utf_domain([$url1]?[$url2]+)*)/";
     $this->mailto_pattern = "/("
         ."[-\w!\#\$%&\'*+~\/^`|{}=]+(?:\.[-\w!\#\$%&\'*+~\/^`|{}=]+)*"  // local-part
         ."@$utf_domain"                                                 // domain-part
         ."(\?[$url1$url2]+)?"                                           // e.g. ?subject=test...
-        .")/i";
+        .")/";
   }
 
   /**
@@ -81,11 +81,11 @@
     $i = -1;
     $scheme = strtolower($matches[1]);
 
-    if (preg_match('!^(http|ftp|file)s?://!', $scheme)) {
+    if (preg_match('!^(http|ftp|file)s?://!i', $scheme)) {
       $url = $matches[1] . $matches[2];
     }
-    else if (preg_match('/^(\W)www\.$/', $matches[1], $m)) {
-      $url        = 'www.' . $matches[2];
+    else if (preg_match('/^(\W*)(www\.)$/i', $matches[1], $m)) {
+      $url        = $m[2] . $matches[2];
       $url_prefix = 'http://';
       $prefix     = $m[1];
     }
@@ -134,6 +134,22 @@
   }
 
   /**
+   * Replace all defined (link|mailto) patterns with replacement string
+   *
+   * @param string $str Text
+   *
+   * @return string Text
+   */
+  public function replace($str)
+  {
+    // search for patterns like links and e-mail addresses
+    $str = preg_replace_callback($this->link_pattern, array($this, 'link_callback'), $str);
+    $str = preg_replace_callback($this->mailto_pattern, array($this, 'mailto_callback'), $str);
+
+    return $str;
+  }
+
+  /**
    * Replace substituted strings with original values
    */
   public function resolve($str)
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index c212025..39bccac 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -786,9 +786,8 @@
   // make links and email-addresses clickable
   $replacer = new rcube_string_replacer;
 
-  // search for patterns like links and e-mail addresses
-  $body = preg_replace_callback($replacer->link_pattern, array($replacer, 'link_callback'), $body);
-  $body = preg_replace_callback($replacer->mailto_pattern, array($replacer, 'mailto_callback'), $body);
+  // search for patterns like links and e-mail addresses and replace with tokens
+  $body = $replacer->replace($body);
 
   // split body into single lines
   $body = preg_split('/\r?\n/', $body);
diff --git a/skins/classic/mail.css b/skins/classic/mail.css
index 4b54f22..f899dbd 100644
--- a/skins/classic/mail.css
+++ b/skins/classic/mail.css
@@ -299,7 +299,6 @@
   bottom: 0px;
   border: 1px solid #999999;
   background-color: #F9F9F9;
-  overflow: hidden;
 }
 
 #messagecontframe
@@ -359,7 +358,6 @@
   bottom: 0;
   border: 1px solid #999;
   background-color: #F9F9F9;
-  overflow: hidden;
 }
 
 #mailboxlist
diff --git a/tests/Framework/StringReplacer.php b/tests/Framework/StringReplacer.php
index 11210c0..6081e53 100644
--- a/tests/Framework/StringReplacer.php
+++ b/tests/Framework/StringReplacer.php
@@ -17,4 +17,28 @@
 
         $this->assertInstanceOf('rcube_string_replacer', $sr, "Class constructor");
     }
+
+    /**
+     * Data for test_replace()
+     */
+    function data_replace()
+    {
+        return array(
+            array('http://domain.tld/path*path2', '<a href="http://domain.tld/path*path2" target="_blank">http://domain.tld/path*path2</a>'),
+            array('www.domain.tld', '<a href="http://www.domain.tld" target="_blank">www.domain.tld</a>'),
+            array('WWW.DOMAIN.TLD', '<a href="http://WWW.DOMAIN.TLD" target="_blank">WWW.DOMAIN.TLD</a>'),
+        );
+    }
+
+    /**
+     * @dataProvider data_replace
+     */
+    function test_replace($input, $output)
+    {
+        $replacer = new rcube_string_replacer;
+        $result = $replacer->replace($input);
+        $result = $replacer->resolve($result);
+
+        $this->assertEquals($output, $result);
+    }
 }

--
Gitblit v1.9.1