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>
This commit is contained in:
Robin Appelman 2011-08-28 19:36:23 +02:00
parent d5c73c6d4a
commit 5c9178f851
1 changed files with 2 additions and 2 deletions

View File

@ -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 ));
}