Use "json_encode" and "json_decode" instead of unserialize

This commit is contained in:
Lukas Reschke 2015-09-02 12:12:31 +02:00
parent 4539377113
commit 36e26c6f09
2 changed files with 4 additions and 4 deletions

View File

@ -206,7 +206,7 @@ class Connection extends LDAPUtility {
}
$key = $this->getCacheKey($key);
return unserialize(base64_decode($this->cache->get($key)));
return json_decode(base64_decode($this->cache->get($key)));
}
/**
@ -240,7 +240,7 @@ class Connection extends LDAPUtility {
return null;
}
$key = $this->getCacheKey($key);
$value = base64_encode(serialize($value));
$value = base64_encode(json_encode($value));
$this->cache->set($key, $value, $this->configuration->ldapCacheTTL);
}

View File

@ -161,7 +161,7 @@ abstract class Proxy {
}
$key = $this->getCacheKey($key);
return unserialize(base64_decode($this->cache->get($key)));
return json_decode(base64_decode($this->cache->get($key)));
}
/**
@ -185,7 +185,7 @@ abstract class Proxy {
return;
}
$key = $this->getCacheKey($key);
$value = base64_encode(serialize($value));
$value = base64_encode(json_encode($value));
$this->cache->set($key, $value, '2592000');
}