aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/body_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/body_controller.rb')
-rw-r--r--app/controllers/body_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb
index 6ad713455..103b500b8 100644
--- a/app/controllers/body_controller.rb
+++ b/app/controllers/body_controller.rb
@@ -4,11 +4,16 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: body_controller.rb,v 1.6 2008-02-27 12:09:03 francis Exp $
+# $Id: body_controller.rb,v 1.7 2008-02-27 13:59:51 francis Exp $
class BodyController < ApplicationController
# XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL
def show
+ if MySociety::Format.simplify_url_part(params[:url_name]) != params[:url_name]
+ redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name])
+ return
+ end
+
@public_bodies = PublicBody.find(:all,
:conditions => [ "url_name = ?", params[:url_name] ])
if @public_bodies.size > 1