Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable8.1] Use "json_encode" and "json_decode" instead of unserialize #22632

Merged
merged 2 commits into from
Feb 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/user_ldap/lib/connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public function getFromCache($key) {
}
$key = $this->getCacheKey($key);

return unserialize(base64_decode($this->cache->get($key)));
return json_decode(base64_decode($this->cache->get($key)), true);
}

/**
Expand Down Expand Up @@ -240,7 +240,7 @@ public function writeToCache($key, $value) {
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);
}

Expand Down
4 changes: 2 additions & 2 deletions apps/user_ldap/lib/proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function getFromCache($key) {
}
$key = $this->getCacheKey($key);

return unserialize(base64_decode($this->cache->get($key)));
return json_decode(base64_decode($this->cache->get($key)));
}

/**
Expand All @@ -185,7 +185,7 @@ public function writeToCache($key, $value) {
return;
}
$key = $this->getCacheKey($key);
$value = base64_encode(serialize($value));
$value = base64_encode(json_encode($value));
$this->cache->set($key, $value, '2592000');
}

Expand Down