aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Page.pm20
-rwxr-xr-xweb-admin/index.cgi5
-rwxr-xr-xweb/alert.cgi4
3 files changed, 16 insertions, 13 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index ad6e25cb9..04c91dc8d 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.63 2007-08-29 23:03:16 matthew Exp $
+# $Id: Page.pm,v 1.64 2007-09-03 20:56:30 matthew Exp $
#
package Page;
@@ -529,13 +529,17 @@ sub geocode_string {
} else {
$js =~ /"coordinates":\[(.*?),(.*?),/;
my $lon = $1; my $lat = $2;
- ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G');
- my $xx = Page::os_to_tile($easting);
- my $yy = Page::os_to_tile($northing);
- $x = int($xx);
- $y = int($yy);
- $x -= 1 if ($xx - $x < 0.5);
- $y -= 1 if ($yy - $y < 0.5);
+ try {
+ ($easting, $northing) = mySociety::GeoUtil::wgs84_to_national_grid($lat, $lon, 'G');
+ my $xx = Page::os_to_tile($easting);
+ my $yy = Page::os_to_tile($northing);
+ $x = int($xx);
+ $y = int($yy);
+ $x -= 1 if ($xx - $x < 0.5);
+ $y -= 1 if ($yy - $y < 0.5);
+ } catch {
+ $error = shift;
+ }
}
}
return ($x, $y, $easting, $northing, $error);
diff --git a/web-admin/index.cgi b/web-admin/index.cgi
index eb4a13350..11c37d239 100755
--- a/web-admin/index.cgi
+++ b/web-admin/index.cgi
@@ -7,10 +7,10 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: index.cgi,v 1.45 2007-08-23 11:45:44 matthew Exp $
+# $Id: index.cgi,v 1.46 2007-09-03 20:56:31 matthew Exp $
#
-my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.45 2007-08-23 11:45:44 matthew Exp $';
+my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.46 2007-09-03 20:56:31 matthew Exp $';
use strict;
@@ -446,6 +446,5 @@ sub main {
} else {
do_summary($q);
}
- dbh()->rollback();
}
Page::do_fastcgi(\&main);
diff --git a/web/alert.cgi b/web/alert.cgi
index 294d35ba8..fd4c74da8 100755
--- a/web/alert.cgi
+++ b/web/alert.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: alert.cgi,v 1.12 2007-08-29 23:37:34 matthew Exp $
+# $Id: alert.cgi,v 1.13 2007-09-03 20:56:31 matthew Exp $
use strict;
use Standard;
@@ -206,7 +206,7 @@ sub alert_front_page {
my $out = <<EOF;
<h1>Local RSS feeds and email alerts</h1>
<form method="get" action="/alert">
-<p>To find out what local alerts we have, please enter your postcode or street name here:
+<p>To find out what local alerts we have, please enter your UK postcode or street name here:
<input type="text" name="pc" value="">
<input type="submit" value="Look up">
</form>