- $name = ((x($_POST,'name')) ? $_POST['name'] : $contact['name']);
- $nick = ((x($_POST,'nick')) ? $_POST['nick'] : '');
- $url = ((x($_POST,'url')) ? $_POST['url'] : '');
- $request = ((x($_POST,'request')) ? $_POST['request'] : '');
- $confirm = ((x($_POST,'confirm')) ? $_POST['confirm'] : '');
- $notify = ((x($_POST,'notify')) ? $_POST['notify'] : '');
- $poll = ((x($_POST,'poll')) ? $_POST['poll'] : '');
- $attag = ((x($_POST,'attag')) ? $_POST['attag'] : '');
- $photo = ((x($_POST,'photo')) ? $_POST['photo'] : '');
- $remote_self = ((x($_POST,'remote_self')) ? $_POST['remote_self'] : false);
- $nurl = normalise_link($url);
+ $name = defaults($_POST, 'name' , $contact['name']);
+ $nick = defaults($_POST, 'nick' , '');
+ $url = defaults($_POST, 'url' , '');
+ $request = defaults($_POST, 'request' , '');
+ $confirm = defaults($_POST, 'confirm' , '');
+ $notify = defaults($_POST, 'notify' , '');
+ $poll = defaults($_POST, 'poll' , '');
+ $attag = defaults($_POST, 'attag' , '');
+ $photo = defaults($_POST, 'photo' , '');
+ $remote_self = defaults($_POST, 'remote_self', false);
+ $nurl = normalise_link($url);