瀏覽代碼

Fixed Incorrect Deserialization of FilterConstant values

Frank van den Bos 2 年之前
父節點
當前提交
2a704c860c
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8 3
      InABox.Core/CoreUtils.cs

+ 8 - 3
InABox.Core/CoreUtils.cs

@@ -545,9 +545,14 @@ namespace InABox.Core
             if (value is string && type == typeof(byte[]))
                 return Convert.FromBase64String(value as string);
 
-            //if (value is string && type == typeof(Memo))
-            //	return new Memo(value as String); // { _data = value as string };
-
+            if (value is FilterConstant && type == typeof(DateTime))
+            {
+                if (Equals(FilterConstant.Now, value))
+                    return DateTime.Now;
+                if (Equals(FilterConstant.Today, value))
+                    return DateTime.Today;
+            }
+            
             if (!(value is IConvertible))
                 return value;