aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-02-10 13:44:49 +0000
committerEdmund von der Burg <evdb@mysociety.org>2011-02-10 13:44:49 +0000
commit89d70df4e7c808041e5e2a6e89ae57382541a7fa (patch)
treef127c8be1a8a0afbed5b544957fb080a3ea04886
parent5699fe2d0c57811fce87740b6555e9892181a882 (diff)
Bug fixes found by running test suite
-rwxr-xr-xbin/test-run4
-rwxr-xr-xweb/rss.cgi5
2 files changed, 5 insertions, 4 deletions
diff --git a/bin/test-run b/bin/test-run
index 3ddccd308..b2fea2fb5 100755
--- a/bin/test-run
+++ b/bin/test-run
@@ -541,9 +541,9 @@ sub do_rss {
my %redirects = (
# should always go to lat lon
- '/rss/n/406886,289126' => '/rss/l/52.499993,-1.899993',
+ '/rss/n/406886,289126' => '/rss/l/52.499994,-1.899993',
'/rss/2524/1779' => '/rss/l/52.480294,-1.896931',
- '/rss/pc/SW1A1AA' => '/rss/l/51.501010,-0.141587',
+ '/rss/pc/SW1A1AA' => '/rss/l/51.50101,-0.141587',
'/rss/l/52.5/-1.9' => '/rss/l/52.5/-1.9',
# go to reports
diff --git a/web/rss.cgi b/web/rss.cgi
index 9a9b4ce18..cb5221537 100755
--- a/web/rss.cgi
+++ b/web/rss.cgi
@@ -88,11 +88,11 @@ sub rss_local_problems {
# 5000/31 as initial scale factor for these RSS feeds, now variable so redirect.
$e = int( ($x * 5000/31) + 0.5 );
$n = int( ($y * 5000/31) + 0.5 );
- ($lat, $lon) = Utils::convert_en_to_latlon($e, $n);
+ ($lat, $lon) = Utils::convert_en_to_latlon_truncated($e, $n);
print $q->redirect(-location => "$base/rss/l/$lat,$lon$d_str$state_qs");
return '';
} elsif ($e && $n) {
- ($lat, $lon) = Utils::convert_en_to_latlon($e, $n);
+ ($lat, $lon) = Utils::convert_en_to_latlon_truncated($e, $n);
print $q->redirect(-location => "$base/rss/l/$lat,$lon$d_str$state_qs");
return '';
} elsif ($pc) {
@@ -103,6 +103,7 @@ sub rss_local_problems {
$error = shift;
};
unless ($error) {
+ ( $lat, $lon ) = map { Utils::truncate_coordinate($_) } ( $lat, $lon );
print $q->redirect(-location => "$base/rss/l/$lat,$lon$d_str$state_qs");
}
return '';