diff --git a/lib/private/AllConfig.php b/lib/private/AllConfig.php
index 745bab367d3d2f856e599df21ed0fd36780240b3..58706e290fb9ba8be8e5c63f96d56c330818fe88 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;
 		}
 	}