From adb118a3a28f3c7f25dfff0c766c96b0bf091aea Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 26 Mar 2012 22:26:06 +0200 Subject: [PATCH] Small change and muting debug. --- ajax/saveproperty.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ajax/saveproperty.php b/ajax/saveproperty.php index 112d9031..924d8736 100644 --- a/ajax/saveproperty.php +++ b/ajax/saveproperty.php @@ -35,9 +35,9 @@ function bailOut($msg) { function debug($msg) { OC_Log::write('contacts','ajax/saveproperty.php: '.$msg, OC_Log::DEBUG); } -foreach ($_POST as $key=>$element) { - debug('_POST: '.$key.'=>'.print_r($element, true)); -} +// foreach ($_POST as $key=>$element) { +// debug('_POST: '.$key.'=>'.print_r($element, true)); +// } $id = isset($_POST['id'])?$_POST['id']:null; $name = isset($_POST['name'])?$_POST['name']:null; @@ -71,11 +71,6 @@ if(is_array($value)){ } else { $value = trim(strip_tags($value)); } -if(!$value) { - bailOut(OC_Contacts_App::$l10n->t('Cannot save empty value.')); -} - -debug('Element: '.$name.', value: '.print_r($value, true)); $vcard = OC_Contacts_App::getContactVCard( $id ); $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); @@ -112,6 +107,10 @@ switch($element) { break; } +if(!$value) { + bailOut(OC_Contacts_App::$l10n->t('Cannot save empty value.')); +} + /* setting value */ switch($element) { case 'BDAY':