From fa841e4353be05d86bf30218a1f25fc5346c68f8 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Wed, 13 Oct 2010 18:04:33 -0700 Subject: [PATCH] Validating TablePrefix - http://orchard.codeplex.com/workitem/16488 --HG-- branch : dev --- .../Modules/Orchard.Setup/Controllers/SetupController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs index f8812fdf7..a4061dc14 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs +++ b/src/Orchard.Web/Modules/Orchard.Setup/Controllers/SetupController.cs @@ -81,6 +81,13 @@ namespace Orchard.Setup.Controllers { ModelState.AddModelError("ConfirmPassword", T("Password confirmation must match").ToString()); } + if(!String.IsNullOrWhiteSpace(model.DatabaseTablePrefix)) { + model.DatabaseTablePrefix = model.DatabaseTablePrefix.Trim(); + if(!Char.IsLetter(model.DatabaseTablePrefix[0])) { + ModelState.AddModelError("DatabaseTablePrefix", T("The table prefix must begin with a letter").Text); + } + } + ValidateMachineKey(); if (!ModelState.IsValid) {