diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-19 12:57:48 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-19 12:57:48 +0100 |
commit | 431750828e27e36b9ee4fe5fe4bb01c754c8c1c4 (patch) | |
tree | 4cf7ea28d2f72348a82603cfd022b0b91a10d2ec /lib/private/AllConfig.php | |
parent | 9834f33d56f64f63b0f05c149418b2c83d5fa37d (diff) | |
download | nextcloud-server-431750828e27e36b9ee4fe5fe4bb01c754c8c1c4.tar.gz nextcloud-server-431750828e27e36b9ee4fe5fe4bb01c754c8c1c4.zip |
Store setUserValue as string in cache
We cache the values we set in the setUserValue function.
However since the values are strings in the database we check if a value
is equal with string comparison
Now if the function was called with a $value of int or float. It would
be stored in the DB (and thus converted to string) and in the cache (not
converted thus as int/float).
Now if another call comes in that sets it to the same value (I'm looking
at you LDAP!). The check would fail since we would be comparing
int/float to string which fails by definition.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AllConfig.php')
-rw-r--r-- | lib/private/AllConfig.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php index 745bab367d3..58706e290fb 100644 --- a/lib/private/AllConfig.php +++ b/lib/private/AllConfig.php @@ -233,7 +233,7 @@ class AllConfig implements \OCP\IConfig { ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter($key))); $qb->execute(); - $this->userCache[$userId][$appName][$key] = $value; + $this->userCache[$userId][$appName][$key] = (string)$value; return; } } @@ -258,7 +258,7 @@ class AllConfig implements \OCP\IConfig { if (!isset($this->userCache[$userId][$appName])) { $this->userCache[$userId][$appName] = array(); } - $this->userCache[$userId][$appName][$key] = $value; + $this->userCache[$userId][$appName][$key] = (string)$value; } } |