Continued with coding convention:

- added curly braces around conditional code blocks
- added space between if/foreach/... and brace
- rewrote a code block so if dbm::is_result() fails it will abort, else the id
  is fetched from INSERT statement
- made some SQL keywords upper-cased and added back-ticks to columns/table names

Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-12-20 21:15:53 +01:00
commit 6e44acfed6
No known key found for this signature in database
GPG key ID: B72F8185C6C7BD78
31 changed files with 173 additions and 127 deletions

View file

@ -157,8 +157,9 @@ function follow_post(App &$a) {
// NOTREACHED
}
if ($_REQUEST['cancel'])
if ($_REQUEST['cancel']) {
goaway($_SESSION['return_url']);
}
$uid = local_user();
$url = notags(trim($_REQUEST['url']));
@ -170,17 +171,21 @@ function follow_post(App &$a) {
$result = new_contact($uid,$url,true);
if($result['success'] == false) {
if($result['message'])
if ($result['success'] == false) {
if ($result['message']) {
notice($result['message']);
}
goaway($return_url);
} elseif ($result['cid'])
}
elseif ($result['cid']) {
goaway(App::get_baseurl().'/contacts/'.$result['cid']);
}
info( t('Contact added').EOL);
if(strstr($return_url,'contacts'))
if (strstr($return_url,'contacts')) {
goaway(App::get_baseurl().'/contacts/'.$contact_id);
}
goaway($return_url);
// NOTREACHED