From: Sven Schöling Date: Thu, 29 Dec 2011 09:41:40 +0000 (+0100) Subject: Autovification sollte auch genau das tun, und nicht clobbern. X-Git-Tag: release-2.7.0beta1~114 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=efd3ab012a05e77ab665f48009c2a0f10ade326c;p=kivitendo-erp.git Autovification sollte auch genau das tun, und nicht clobbern. --- diff --git a/SL/Request.pm b/SL/Request.pm index d339cb7be..57b729798 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -153,8 +153,8 @@ sub _recode_recursively { # though. $to->{$key} = $iconv->convert("" . $from->{$key}); } else { - $to->{$key} = {} if 'HASH' eq ref $from->{$key}; - $to->{$key} = [] if 'ARRAY' eq ref $from->{$key}; + $to->{$key} ||= {} if 'HASH' eq ref $from->{$key}; + $to->{$key} ||= [] if 'ARRAY' eq ref $from->{$key}; _recode_recursively($iconv, $from->{$key}, $to->{$key}); } } @@ -167,8 +167,8 @@ sub _recode_recursively { # though. $from->[$idx] = $iconv->convert("" . $from->[$idx]); } else { - $to->[$idx] = {} if 'HASH' eq ref $from->[$idx]; - $to->[$idx] = [] if 'ARRAY' eq ref $from->[$idx]; + $to->[$idx] ||= {} if 'HASH' eq ref $from->[$idx]; + $to->[$idx] ||= [] if 'ARRAY' eq ref $from->[$idx]; _recode_recursively($iconv, $from->[$idx], $to->[$idx]); } }