Parcourir la source

default on string value if json decode fails

tags/0.1.11
Robin Thoni il y a 10 ans
Parent
révision
853b9d9d86
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3
    0
      src/Utils/LuRoute.php

+ 3
- 0
src/Utils/LuRoute.php Voir le fichier

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

Chargement…
Annuler
Enregistrer