fix injection bugs in table editor
This commit is contained in:
+2
-2
@@ -88,7 +88,7 @@ function vali($arr) {
|
||||
*/
|
||||
function old_json($name, $default) {
|
||||
$old = old($name, null);
|
||||
if (is_string($old)) return json_decode($old);
|
||||
if (is_string($old)) return fromJSON($old);
|
||||
return $default;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ function toJSON($object, $emptyObj=false) {
|
||||
$object = $object->toArray();
|
||||
}
|
||||
|
||||
return \GuzzleHttp\json_encode($object, JSON_UNESCAPED_SLASHES + JSON_UNESCAPED_UNICODE);
|
||||
return \GuzzleHttp\json_encode($object);
|
||||
}
|
||||
|
||||
function fromJSON($object, $assoc=false) {
|
||||
|
||||
Reference in New Issue
Block a user