Fixed up the file uploading and the readonly property editors and saving/updating their data/control based on the data changed on the server side.

U4-2680 Fix file uploading
This commit is contained in:
Shannon
2013-08-21 17:54:30 +10:00
parent 466b2a1cb2
commit 5581af2d25
17 changed files with 362 additions and 146 deletions

View File

@@ -28,6 +28,19 @@ namespace Umbraco.Core
[UmbracoWillObsolete("Do not use this constants. See IShortStringHelper.CleanStringForSafeAliasJavaScriptCode.")]
public const string UmbracoInvalidFirstCharacters = "01234567890";
/// <summary>
/// This tries to detect a json string, this is not a fail safe way but it is quicker than doing
/// a try/catch when deserializing when it is not json.
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
internal static bool DetectIsJson(this string input)
{
input = input.Trim();
return input.StartsWith("{") && input.EndsWith("}")
|| input.StartsWith("[") && input.EndsWith("]");
}
internal static string ReplaceNonAlphanumericChars(this string input, char replacement)
{
//any character that is not alphanumeric, convert to a hyphen