Skip to content
Snippets Groups Projects
Commit 5c9178f8 authored by Robin Appelman's avatar Robin Appelman
Browse files

Fixed a bug in appconfig, where an initially empty set value led to endless...

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>
parent d5c73c6d
No related branches found
No related tags found
No related merge requests found
......@@ -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 ));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment