aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/services_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb
index 5156f3416..38bf51772 100644
--- a/app/controllers/services_controller.rb
+++ b/app/controllers/services_controller.rb
@@ -13,8 +13,9 @@ class ServicesController < ApplicationController
old_fgt_locale = FastGettext.locale
begin
FastGettext.locale = FastGettext.best_locale_in(request.env['HTTP_ACCEPT_LANGUAGE'])
- if found_country && found_country[:country_name]
- text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}", :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
+ if found_country && found_country[:country_name] && found_country[:url] && found_country[:name]
+ text = _("Hello! You can make Freedom of Information requests within {{country_name}} at {{link_to_website}}",
+ :country_name => found_country[:country_name], :link_to_website => "<a href=\"#{found_country[:url]}\">#{found_country[:name]}</a>")
else
current_country = WorldFOIWebsites.by_code(iso_country_code)[:country_name]
text = _("Hello! We have an <a href=\"/help/alaveteli?country_name=#{CGI.escape(current_country)}\">important message</a> for visitors outside {{country_name}}", :country_name => current_country)