diff options
-rwxr-xr-x | web-admin/index.cgi | 4 | ||||
-rwxr-xr-x | web/index.cgi | 3 | ||||
-rwxr-xr-x | web/reports.cgi | 3 |
3 files changed, 6 insertions, 4 deletions
diff --git a/web-admin/index.cgi b/web-admin/index.cgi index 5d6df9256..8c7a591cd 100755 --- a/web-admin/index.cgi +++ b/web-admin/index.cgi @@ -19,7 +19,7 @@ use FindBin; use lib "$FindBin::Bin/../perllib"; use lib "$FindBin::Bin/../commonlib/perllib"; use Encode; -use POSIX qw(strftime); +use POSIX qw(strftime strcoll); use Digest::MD5 qw(md5_hex); use Page; @@ -198,7 +198,7 @@ sub admin_councils_list ($) { my $cobrand = Page::get_cobrand($q); my @area_types = Cobrand::area_types($cobrand); my $areas = mySociety::MaPit::call('areas', \@area_types); - my @councils_ids = sort { $areas->{$a}->{name} cmp $areas->{$b}->{name} } keys %$areas; + my @councils_ids = sort { strcoll($areas->{$a}->{name}, $areas->{$b}->{name}) } keys %$areas; my $bci_info = dbh()->selectall_hashref(" select area_id, count(*) as c, count(case when deleted then 1 else null end) as deleted, count(case when confirmed then 1 else null end) as confirmed diff --git a/web/index.cgi b/web/index.cgi index b3c31585e..f027d2da3 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -14,6 +14,7 @@ use Error qw(:try); use File::Slurp; use RABX; use CGI::Carp; +use POSIX qw(strcoll); use URI::Escape; # use Carp::Always; @@ -551,7 +552,7 @@ please specify the closest point on land.')) unless %$all_councils; my $categories = select_all("select area_id, category from contacts where deleted='f' and area_id in (" . join(',', keys %$all_councils) . ')'); if ($q->{site} ne 'emptyhomes') { - @$categories = sort { $a->{category} cmp $b->{category} } @$categories; + @$categories = sort { strcoll($a->{category}, $b->{category}) } @$categories; foreach (@$categories) { $council_ok{$_->{area_id}} = 1; next if $_->{category} eq _('Other'); diff --git a/web/reports.cgi b/web/reports.cgi index f0ecf9c7a..784c52917 100755 --- a/web/reports.cgi +++ b/web/reports.cgi @@ -12,6 +12,7 @@ use strict; use Standard; use Encode; +use POSIX qw(strcoll); use URI::Escape; use FixMyStreet::Alert; use mySociety::MaPit; @@ -201,7 +202,7 @@ sub main { print '<th>' . _('Old problems,<br>state unknown') . '</th>'; } print '<th>' . _('Recently fixed') . '</th><th>' . _('Older fixed') . '</th></tr>'; - foreach (sort { $areas_info->{$a}->{name} cmp $areas_info->{$b}->{name} } keys %$areas_info) { + foreach (sort { strcoll($areas_info->{$a}->{name}, $areas_info->{$b}->{name}) } keys %$areas_info) { next if mySociety::Config::get('COUNTRY') eq 'NO' && $_ eq 301; # Only want one Oslo print '<tr align="center"'; ++$c; |