Skip to content

Commit

Permalink
Merge pull request #815 from Orckestra/dev
Browse files Browse the repository at this point in the history
C1 CMS v6.13
  • Loading branch information
napernik authored Sep 27, 2022
2 parents a2c1c38 + 2c4c8cf commit 119ff09
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 14 deletions.
9 changes: 6 additions & 3 deletions Composite/Core/Serialization/CompositeJsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ public static T Deserialize<T>(string str)
var obj = JsonConvert.DeserializeObject<T>(str, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Auto,
Binder = CompositeSerializationBinder.Instance
Binder = CompositeSerializationBinder.Instance,
MaxDepth = 128
});

return obj;
Expand Down Expand Up @@ -168,7 +169,8 @@ public static T Deserialize<T>(params string[] strs)
var obj = JsonConvert.DeserializeObject<T>(combinedObj.ToString(), new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Auto,
Binder = CompositeSerializationBinder.Instance
Binder = CompositeSerializationBinder.Instance,
MaxDepth = 128
});

return obj;
Expand All @@ -184,7 +186,8 @@ public static object Deserialize(string str)
var obj = JsonConvert.DeserializeObject(str, new JsonSerializerSettings
{
TypeNameHandling = TypeNameHandling.Objects,
Binder = CompositeSerializationBinder.Instance
Binder = CompositeSerializationBinder.Instance,
MaxDepth = 128
});

return obj;
Expand Down
25 changes: 18 additions & 7 deletions Composite/Core/Serialization/CompositeSerializationBinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,30 @@ public override Type BindToType(string assemblyName, string typeName)

var type = base.BindToType(assemblyName, typeName);

if (!TypeIsSupported(assemblyName, typeName, type))
{
throw new NotSupportedException($"Not supported object type '{typeName}'");
}
VerityTypeIsSupported(new AssemblyName(assemblyName), typeName, type);

return type;
}

private bool TypeIsSupported(string assemblyName, string typeName, Type type)
private void VerityTypeIsSupported(AssemblyName assemblyName, string typeFullName, Type type)
{
assemblyName = new AssemblyName(assemblyName).Name;
if (!TypeIsSupported(assemblyName, typeFullName, type))
{
throw new NotSupportedException($"Not supported object type '{typeFullName}'");
}

if (assemblyName == typeof(object).Assembly.GetName().Name /* "mscorlib" */)
if (type.IsGenericType)
{
foreach (var typeArgument in type.GetGenericArguments())
{
VerityTypeIsSupported(typeArgument.Assembly.GetName(), typeArgument.FullName, typeArgument);
}
}
}

private bool TypeIsSupported(AssemblyName assemblyName, string typeName, Type type)
{
if (assemblyName.Name == typeof(object).Assembly.GetName().Name /* "mscorlib" */)
{
var dotOffset = typeName.LastIndexOf(".", StringComparison.Ordinal);
if (dotOffset > 0)
Expand Down
21 changes: 20 additions & 1 deletion Composite/Core/WebClient/Media/ImageResizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using System.Web.Caching;
Expand Down Expand Up @@ -412,5 +411,25 @@ public static bool TargetMediaTypeSupported(string mediaType)

return ImageFormatProviders.ContainsKey(mediaType);
}

/// <exclude />
[Obsolete]
public class SupportedImageFormats
{
/// <exclude />
public static ImageFormat JPG => ImageFormat.Jpeg;

/// <exclude />
public static ImageFormat PNG => ImageFormat.Png;

/// <exclude />
public static ImageFormat TIFF => ImageFormat.Tiff;

/// <exclude />
public static ImageFormat GIF => ImageFormat.Gif;

/// <exclude />
public static ImageFormat BMP => ImageFormat.Bmp;
}
}
}
1 change: 1 addition & 0 deletions Composite/Data/DynamicTypes/DataTypeDescriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ public DataTypeDescriptor Clone()
BuildNewHandlerTypeName = this.BuildNewHandlerTypeName,
LabelFieldName = this.LabelFieldName,
InternalUrlPrefix = this.InternalUrlPrefix,
Cachable = this.Cachable,
Searchable = this.Searchable
};

Expand Down
6 changes: 3 additions & 3 deletions Composite/Properties/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

// General Information about the assemblies Composite and Composite.Workflows
#if !InternalBuild
[assembly: AssemblyTitle("C1 CMS 6.12")]
[assembly: AssemblyTitle("C1 CMS 6.13")]
#else
[assembly: AssemblyTitle("C1 CMS 6.12 (Internal Build)")]
[assembly: AssemblyTitle("C1 CMS 6.13 (Internal Build)")]
#endif

[assembly: AssemblyCompany("Orckestra Technologies Inc.")]
Expand All @@ -13,4 +13,4 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: AssemblyVersion("6.12.*")]
[assembly: AssemblyVersion("6.13.*")]

0 comments on commit 119ff09

Please sign in to comment.