From a5869799758e4e79094778cd7df21a013d5fb3ba Mon Sep 17 00:00:00 2001 From: francis Date: Mon, 7 Sep 2009 17:31:36 +0000 Subject: Don't allow numeric only URL names. Test the URL name code a bit. --- app/controllers/user_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index c3b2efc03..4b4846ff1 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_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: user_controller.rb,v 1.69 2009-09-02 14:10:38 francis Exp $ +# $Id: user_controller.rb,v 1.70 2009-09-07 17:31:38 francis Exp $ class UserController < ApplicationController # Show page about a user def show - if MySociety::Format.simplify_url_part(params[:url_name], 32) != params[:url_name] - redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name], 32), :status => :moved_permanently + if MySociety::Format.simplify_url_part(params[:url_name], 'user', 32) != params[:url_name] + redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name], 'user', 32), :status => :moved_permanently return end -- cgit v1.2.3