aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2009-08-14 11:02:50 +0000
committermatthew <matthew>2009-08-14 11:02:50 +0000
commitbfa3fb4f68e00d76494dfe6f417d45d40d5b1de5 (patch)
tree428f4d9ef0e5a335ce82780a2c7b7d345c7bc296
parentfe74cdd9f87b1fe779254da484ca0e1f9d713b90 (diff)
Only do lang on reportemptyhomes!
-rw-r--r--perllib/Page.pm7
-rwxr-xr-xweb/alert.cgi4
-rwxr-xr-xweb/index.cgi6
3 files changed, 9 insertions, 8 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index efb126d80..28004f6ee 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.158 2009-08-12 11:55:12 matthew Exp $
+# $Id: Page.pm,v 1.159 2009-08-14 11:02:50 matthew Exp $
#
package Page;
@@ -123,8 +123,9 @@ sub microsite {
}
sub base_url_with_lang {
- my $reverse = shift;
+ my ($q, $reverse) = @_;
my $base = mySociety::Config::get('BASE_URL');
+ return $base unless $q->{site} eq 'emptyhomes';
my $lang = $mySociety::Locale::lang;
if ($reverse && $lang eq 'en-gb') {
$base =~ s{http://}{$&cy.};
@@ -172,7 +173,7 @@ sub header ($%) {
close FP;
my %vars;
if ($q->{site} eq 'emptyhomes') {
- my $lang_url = base_url_with_lang(1);
+ my $lang_url = base_url_with_lang($q, 1);
$lang_url .= $ENV{REQUEST_URI} if $ENV{REQUEST_URI};
%vars = (
'report' => _('Report a problem'),
diff --git a/web/alert.cgi b/web/alert.cgi
index cb77a8e4c..5284e39a5 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.41 2009-08-12 11:55:13 matthew Exp $
+# $Id: alert.cgi,v 1.42 2009-08-14 11:02:50 matthew Exp $
use strict;
use Standard;
@@ -405,7 +405,7 @@ sub alert_do_subscribe {
}
my %h = ();
- $h{url} = Page::base_url_with_lang() . '/A/'
+ $h{url} = Page::base_url_with_lang($q) . '/A/'
. mySociety::AuthToken::store('alert', { id => $alert_id, type => 'subscribe', email => $email } );
dbh()->commit();
return Page::send_email($q, $email, undef, 'alert', %h);
diff --git a/web/index.cgi b/web/index.cgi
index c7c47950f..60b808141 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.268 2009-08-13 16:20:44 matthew Exp $
+# $Id: index.cgi,v 1.269 2009-08-14 11:02:50 matthew Exp $
use strict;
use Standard;
@@ -244,7 +244,7 @@ sub submit_update {
my %h = ();
$h{update} = $input{update};
$h{name} = $input{name} ? $input{name} : _("Anonymous");
- my $base = Page::base_url_with_lang();
+ my $base = Page::base_url_with_lang($q);
$base =~ s/matthew/scambs.matthew/ if $q->{site} eq 'scambs'; # XXX Temp
$h{url} = $base . '/C/' . mySociety::AuthToken::store('update', { id => $id, add_alert => $input{add_alert} } );
dbh()->commit();
@@ -413,7 +413,7 @@ Please <a href="/contact">let us know what went on</a> and we\'ll look into it.'
$h{title} = $input{title};
$h{detail} = $input{detail};
$h{name} = $input{name};
- my $base = Page::base_url_with_lang();
+ my $base = Page::base_url_with_lang($q);
$base =~ s/matthew/scambs.matthew/ if $q->{site} eq 'scambs'; # XXX Temp
$h{url} = $base . '/P/' . mySociety::AuthToken::store('problem', $id);
dbh()->commit();