diff options
-rw-r--r-- | Kolab-Conf/Changes | 3 | ||||
-rw-r--r-- | Kolab-Conf/Conf.pm.in | 23 |
2 files changed, 16 insertions, 10 deletions
diff --git a/Kolab-Conf/Changes b/Kolab-Conf/Changes index c84954f..04a9413 100644 --- a/Kolab-Conf/Changes +++ b/Kolab-Conf/Changes @@ -3,4 +3,5 @@ Revision history for Perl extension Kolab::Conf. 0.01 Thu Nov 6 14:07:19 2003 - original version; created by h2xs 1.22 with options -XA -n Kolab::Conf - +0.02 Sa 6. Jan 22:35:25 2007 + - fixes order of domains see also https://intevation.de/roundup/kolab/issue1550 diff --git a/Kolab-Conf/Conf.pm.in b/Kolab-Conf/Conf.pm.in index f027cbe..89af10c 100644 --- a/Kolab-Conf/Conf.pm.in +++ b/Kolab-Conf/Conf.pm.in @@ -4,12 +4,12 @@ package Kolab::Conf; ## Copyright (c) 2004 Klaraelvdalens Datakonsult AB ## Copyright (c) 2003 Code Fusion cc ## -## Writen by Stuart Bingë <s.binge@codefusion.co.za> +## Written by Stuart Bingë <s.binge@codefusion.co.za> ## Portions based on work by the following people: ## -## (c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de> -## (c) 2003 Martin Konold <martin.konold@erfrakon.de> -## (c) 2003 Achim Frank <achim.frank@erfrakon.de> +## (c) 2003 Tassilo Erlewein <tassilo.erlewein@erfrakon.de> +## (c) 2003-2006 Martin Konold <martin.konold@erfrakon.de> +## (c) 2003 Achim Frank <achim.frank@erfrakon.de> ## ## ## This program is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ package Kolab::Conf; ## You can view the GNU General Public License, online, at the GNU ## Project's homepage; see <http://www.gnu.org/licenses/gpl.html>. ## - +## Version 0.02 use 5.008; use strict; use warnings; @@ -277,11 +277,16 @@ sub build { } else { # Modifier functions SWITCH: { - # Join function + # Join function $fct eq 'join' && do { - $val = join $args, (ref $Kolab::config{$attr} eq "ARRAY") - ?@{$Kolab::config{$attr}} - :($Kolab::config{$attr}); + if (ref $Kolab::config{$attr} eq "ARRAY") { + my @vals = @{$Kolab::config{$attr}} ; + # We want to make sure subdomain.domain.tld comes before domain.tld + my @length_sorted_vals = sort {length $a cmp length $b} @vals; + $val = join ($args, @length_sorted_vals) ; + } else { + $val = $Kolab::config{$attr}; + } last SWITCH; }; # Quote function |