From 87a2f686f0c0477a33ffe563321cc3eda89e021f Mon Sep 17 00:00:00 2001 From: alecpl Date: Fri, 24 Jun 2011 18:46:37 +0000 Subject: - Fix contacts copying (#1487967) --- program/steps/addressbook/copy.inc | 2 +- program/steps/addressbook/func.inc | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'program/steps/addressbook') diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc index 4ee885b3f..1e4e753b6 100644 --- a/program/steps/addressbook/copy.inc +++ b/program/steps/addressbook/copy.inc @@ -40,7 +40,7 @@ foreach ($cids as $source => $cid) // It maight happen when copying records from search result // Do nothing, go to next source - if ($target == $source) { + if ((string)$target == (string)$source) { continue; } diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 0f2d75705..f7f3dbfe9 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -670,7 +670,7 @@ function rcmail_get_cids() // containing contact ID and source name in form: - $cid = get_input_value('_cid', RCUBE_INPUT_GPC); - $source = get_input_value('_source', RCUBE_INPUT_GPC); + $source = (string) get_input_value('_source', RCUBE_INPUT_GPC); if (!preg_match('/^[a-zA-Z0-9\+\/=_-]+(,[a-zA-Z0-9\+\/=_-]+)*$/', $cid)) { return array(); @@ -686,10 +686,7 @@ function rcmail_get_cids() if (!$got_source) { list ($c, $s) = explode('-', $id, 2); if (strlen($s)) { - $result[$s][] = $c; - } - else if (strlen($source)) { - $result[$source][] = $c; + $result[(string)$s][] = $c; } } else { -- cgit v1.2.3