Re-fixes: U4-4211 User without media section permission will be logged out immediately when accessing a document type using a media picker datatype (u7.0.3)
This commit is contained in:
@@ -10,6 +10,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Configuration;
|
||||
using System.Web.Security;
|
||||
using Umbraco.Core.Strings;
|
||||
@@ -52,6 +53,28 @@ namespace Umbraco.Core
|
||||
|| (input.StartsWith("[") && input.EndsWith("]"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a JObject/JArray instance if the string can be converted to json, otherwise returns the string
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
internal static object ConvertToJsonIfPossible(this string input)
|
||||
{
|
||||
if (input.DetectIsJson() == false)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
try
|
||||
{
|
||||
var obj = JsonConvert.DeserializeObject(input);
|
||||
return obj;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
internal static string ReplaceNonAlphanumericChars(this string input, char replacement)
|
||||
{
|
||||
//any character that is not alphanumeric, convert to a hyphen
|
||||
|
||||
Reference in New Issue
Block a user