浏览代码

default on string value if json decode fails

tags/0.1.11
Robin Thoni 8 年前
父节点
当前提交
853b9d9d86
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      src/Utils/LuRoute.php

+ 3
- 0
src/Utils/LuRoute.php 查看文件

@@ -70,6 +70,9 @@ class LuRoute {
70 70
             try
71 71
             {
72 72
                 $json = json_decode($value, true);
73
+                if (is_null($json)) {
74
+                    $json = $value . "";
75
+                }
73 76
                 $typedValue = call_user_func_array(array($class->getName(), "jsonDeserialize"), array($json));
74 77
             }
75 78
             catch (LuDboDeserializeException $e)

正在加载...
取消
保存