aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers/link_to_helper.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-01-12 13:52:36 +0000
committerRobin Houston <robin.houston@gmail.com>2012-01-12 13:52:36 +0000
commitd84353a0dbff7c4543c7f4423d7b63728c7041c3 (patch)
tree2bcfaa2b7cbe0eedccad518c8c2d064203a2143c /app/helpers/link_to_helper.rb
parent2d0524b90108004d67b5ee7f21b7b69ebf8eb3df (diff)
parent21ee1ca03faa722119a3c7e587a843b960783096 (diff)
Merge branch 'release/0.5' of github.com:sebbacon/alaveteli into release/0.5
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