summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-09-04 11:40:01 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-09-04 11:40:01 +0200
commitc9457fdcad565fd27e607c2f09487988cf458aa3 (patch)
treed9e10e0780b4bf7986d1e6a09b9f1aa644e3c61e
parent3bc287ff6335842854c3d4058aad870654b50ad4 (diff)
parent36e26c6f090ae3fa5ebc678cce216820ff21a3e7 (diff)
downloadnextcloud-server-c9457fdcad565fd27e607c2f09487988cf458aa3.tar.gz
nextcloud-server-c9457fdcad565fd27e607c2f09487988cf458aa3.zip
Merge pull request #18762 from owncloud/use-json-instead-of-unserialize
Use "json_encode" and "json_decode" instead of unserialize
-rw-r--r--apps/user_ldap/lib/connection.php4
-rw-r--r--apps/user_ldap/lib/proxy.php4
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 6f2fdce1b5f..f6b123babd0 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -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);
}
diff --git a/apps/user_ldap/lib/proxy.php b/apps/user_ldap/lib/proxy.php
index ef01213990c..2a423cb0e4b 100644
--- a/apps/user_ldap/lib/proxy.php
+++ b/apps/user_ldap/lib/proxy.php
@@ -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');
}