Skip to content

Commit

Permalink
Merge pull request #18762 from owncloud/use-json-instead-of-unserialize
Browse files Browse the repository at this point in the history
Use "json_encode" and "json_decode" instead of unserialize
  • Loading branch information
MorrisJobke committed Sep 4, 2015
2 parents 3bc287f + 36e26c6 commit c9457fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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)));
}

/**
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

0 comments on commit c9457fd

Please sign in to comment.