From f2f376d46d3f2dfd1ac83847db8259a8b00cefda Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 2 Dec 2011 14:05:40 -0800 Subject: [PATCH] #18255: Fixing field name sanitizing Work Item: 18255 --HG-- branch : 1.x --- .../Services/ContentDefinitionService.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs b/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs index fe04b5f86..d648e96cd 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs +++ b/src/Orchard.Web/Modules/Orchard.ContentTypes/Services/ContentDefinitionService.cs @@ -241,10 +241,8 @@ namespace Orchard.ContentTypes.Services { name = name.Trim(); // don't allow non A-Z chars as first letter, as they are not allowed in prefixes - if(name.Length > 0) { - if (!IsLetter(name[0])) { - name = name.Substring(1); - } + while(name.Length > 0 && !IsLetter(name[0])) { + name = name.Substring(1); } if (name.Length > 128)