diff options
author | francis <francis> | 2009-09-07 17:31:36 +0000 |
---|---|---|
committer | francis <francis> | 2009-09-07 17:31:36 +0000 |
commit | a5869799758e4e79094778cd7df21a013d5fb3ba (patch) | |
tree | 4338316f601a170c349f3d7e044db90e1f7778ca /app/controllers/public_body_controller.rb | |
parent | cd3baa5e71a1ef17d3e43b839e8e68b08533799e (diff) |
Don't allow numeric only URL names.
Test the URL name code a bit.
Diffstat (limited to 'app/controllers/public_body_controller.rb')
-rw-r--r-- | app/controllers/public_body_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb index 19bb22f67..21ef45677 100644 --- a/app/controllers/public_body_controller.rb +++ b/app/controllers/public_body_controller.rb @@ -4,13 +4,13 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: public_body_controller.rb,v 1.5 2009-09-02 14:10:37 francis Exp $ +# $Id: public_body_controller.rb,v 1.6 2009-09-07 17:31:36 francis Exp $ class PublicBodyController < 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]), :status => :moved_permanently + if MySociety::Format.simplify_url_part(params[:url_name], 'body') != params[:url_name] + redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name], 'body'), :status => :moved_permanently return end |