summaryrefslogtreecommitdiffstats
path: root/lib/appconfig.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-08-28 19:36:23 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-08-28 19:36:23 +0200
commit5c9178f85161c90c4c58c6ab68b2828938908845 (patch)
treef1289754555eed2743c654c067f56fe02eff76dd /lib/appconfig.php
parentd5c73c6d4ab525d54d4a490a30fc6e86cf9a38b5 (diff)
downloadnextcloud-server-5c9178f85161c90c4c58c6ab68b2828938908845.tar.gz
nextcloud-server-5c9178f85161c90c4c58c6ab68b2828938908845.zip
Fixed a bug in appconfig, where an initially empty set value led to endless duplicates of this app/key pair.
Path by Elias Probst <mail@eliasprobst.eu>
Diffstat (limited to 'lib/appconfig.php')
-rw-r--r--lib/appconfig.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php
index 06281d38585..c64a15b8938 100644
--- a/lib/appconfig.php
+++ b/lib/appconfig.php
@@ -114,10 +114,10 @@ class OC_Appconfig{
*/
public static function setValue( $app, $key, $value ){
// Does the key exist? yes: update. No: insert
- $exists = self::getValue( $app, $key, null );
+ $exists = self::getKeys( $app );
// null: does not exist
- if( is_null( $exists )){
+ if( !in_array( $key, $exists )){
$query = OC_DB::prepare( 'INSERT INTO *PREFIX*appconfig ( appid, configkey, configvalue ) VALUES( ?, ?, ? )' );
$query->execute( array( $app, $key, $value ));
}