summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-06-02 12:36:32 +0000
committeralecpl <alec@alec.pl>2011-06-02 12:36:32 +0000
commit187833dff94146a9b176a1ca4a5c9996809fd4a7 (patch)
tree8018d76e44be79286d116d0588b7bec0298f5432 /program
parentfcbf7a12fff1a3cd8bbace46d9b61e4ce5b6a7ce (diff)
- Apply fixes from trunk
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc4
-rw-r--r--program/lib/washtml.php2
-rw-r--r--program/steps/mail/func.inc2
-rw-r--r--program/steps/settings/save_identity.inc11
4 files changed, 13 insertions, 6 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 72a190595..3c04e20bf 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1916,6 +1916,10 @@ function rcube_idn_convert($input, $is_utf=false)
$domain = $is_utf ? idn_to_ascii($domain) : idn_to_utf8($domain);
+ if ($domain === false) {
+ return '';
+ }
+
return $at ? $user . '@' . $domain : $domain;
}
diff --git a/program/lib/washtml.php b/program/lib/washtml.php
index e8befe835..a5eeb841b 100644
--- a/program/lib/washtml.php
+++ b/program/lib/washtml.php
@@ -274,7 +274,7 @@ class washtml
// Remove invalid HTML comments (#1487759)
// Don't remove valid conditional comments
- $html = preg_replace('/<!--[^->[]*>/', '', $html);
+ $html = preg_replace('/<!--[^->[\n]*>/', '', $html);
@$node->loadHTML($html);
return $this->dumpHtml($node);
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 5160027f2..d738322b7 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -575,7 +575,7 @@ function rcmail_wash_html($html, $p = array(), $cid_replaces)
'',
'<html>',
);
- $html = preg_replace($html_search, $html_replace, $html);
+ $html = preg_replace($html_search, $html_replace, trim($html));
// PCRE errors handling (#1486856), should we use something like for every preg_* use?
if ($html === null && ($preg_error = preg_last_error()) != PREG_NO_ERROR) {
diff --git a/program/steps/settings/save_identity.inc b/program/steps/settings/save_identity.inc
index c8d258fd7..dbb4d4738 100644
--- a/program/steps/settings/save_identity.inc
+++ b/program/steps/settings/save_identity.inc
@@ -116,9 +116,12 @@ else if (IDENTITIES_LEVEL < 2)
$plugin = $RCMAIL->plugins->exec_hook('identity_create', array('record' => $save_data));
$save_data = $plugin['record'];
- $save_data['email'] = rcube_idn_to_ascii($save_data['email']);
- $save_data['bcc'] = rcube_idn_to_ascii($save_data['bcc']);
- $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']);
+ if ($save_data['email'])
+ $save_data['email'] = rcube_idn_to_ascii($save_data['email']);
+ if ($save_data['bcc'])
+ $save_data['bcc'] = rcube_idn_to_ascii($save_data['bcc']);
+ if ($save_data['reply-to'])
+ $save_data['reply-to'] = rcube_idn_to_ascii($save_data['reply-to']);
if (!$plugin['abort'])
$insert_id = $save_data['email'] ? $USER->insert_identity($save_data) : null;
@@ -127,7 +130,7 @@ else if (IDENTITIES_LEVEL < 2)
if ($insert_id) {
$OUTPUT->show_message('successfullysaved', 'confirmation', null, false);
-
+
$_GET['_iid'] = $insert_id;
if (!empty($_POST['_standard']))