aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/link_to_helper.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-11 17:16:13 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-11 17:16:13 +0000
commit883a720e0efbf44e198dffd8efcf65f8d219b08e (patch)
treeac18d2ab593fa91dfa1708fa290bb1a2662bdc8e /app/helpers/link_to_helper.rb
parentd734493ce3bcade2c6a819fc98f9b60c860c3fa7 (diff)
parentf098a984efacc9cb486991e9ea2da206cf853c6e (diff)
Merge branch 'release/0.5' into develop
Diffstat (limited to 'app/helpers/link_to_helper.rb')
-rwxr-xr-xapp/helpers/link_to_helper.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/app/helpers/link_to_helper.rb b/app/helpers/link_to_helper.rb
index 5866c31f0..7903dee2a 100755
--- a/app/helpers/link_to_helper.rb
+++ b/app/helpers/link_to_helper.rb
@@ -189,10 +189,14 @@ module LinkToHelper
url_prefix = "http://" + MySociety::Config.get("DOMAIN", '127.0.0.1:3000')
url = url_prefix + relative_path
if !append.nil?
- env = Rack::MockRequest.env_for(url)
- req = Rack::Request.new(env)
- req.path_info += append
- url = req.url
+ begin
+ env = Rack::MockRequest.env_for(url)
+ req = Rack::Request.new(env)
+ req.path_info += append
+ url = req.url
+ rescue URI::InvalidURIError
+ # don't append to it
+ end
end
return url
end