U4-3027 - fix content & property types alias casing

This commit is contained in:
Stephan
2014-04-24 00:16:56 +02:00
parent 0810e90478
commit ee210ae5d8
6 changed files with 21 additions and 9 deletions

View File

@@ -20,9 +20,11 @@ namespace Umbraco.Web.WebServices
[HttpGet]
public JsonResult ToSafeAlias(string value, bool camelCase = true)
{
// always return a proper camel-cased alias
// when checking... javascript does a case-unsensitive comparison
return value == null
? Json(new {error = "no value."}, JsonRequestBehavior.AllowGet)
: Json(new { alias = value.ToSafeAlias(camelCase) }, JsonRequestBehavior.AllowGet);
: Json(new { alias = value.ToCleanString(CleanStringType.Alias | CleanStringType.CamelCase) }, JsonRequestBehavior.AllowGet);
}
[HttpGet]