mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
rename (un)serialise() -> json_(un)serialize()
This commit is contained in:
@@ -4088,17 +4088,17 @@ function svg2bb($s) {
|
||||
return EMPTY_STR;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function serialise($x) {
|
||||
function json_serialize($x) {
|
||||
return ((is_array($x)) ? 'json:' . json_encode($x) : $x);
|
||||
}
|
||||
|
||||
function unserialise($x) {
|
||||
function json_unserialize($x) {
|
||||
if (is_array($x)) {
|
||||
return $x;
|
||||
}
|
||||
|
||||
$y = ((str_starts_with($x, 'json:')) ? json_decode(substr($x, 5), true) : '');
|
||||
|
||||
return ((is_array($y)) ? $y : $x);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user