Coding convention applied:

- space between "if" and brace
- curly braces on conditional blocks

Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
Roland Häder 2016-12-20 10:10:33 +01:00
parent dac1dbd3e9
commit fb676335db
53 changed files with 117 additions and 87 deletions

View file

@ -105,8 +105,9 @@ class dfrn {
dbesc($owner_nick)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$owner = $r[0];
$owner_id = $owner['uid'];
@ -139,8 +140,9 @@ class dfrn {
intval($owner_id)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$contact = $r[0];
require_once('include/security.php');

View file

@ -143,13 +143,14 @@ function group_add_member($uid,$name,$member,$gid = 0) {
return true; // You might question this, but
// we indicate success because the group member was in fact created
// -- It was just created at another time
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
$r = q("INSERT INTO `group_member` (`uid`, `gid`, `contact-id`)
VALUES( %d, %d, %d ) ",
intval($uid),
intval($gid),
intval($member)
);
}
return $r;
}

View file

@ -78,8 +78,9 @@ function do_like($item_id, $verb) {
intval($item['contact-id']),
intval($item['uid'])
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return false;
}
if(! $r[0]['self'])
$remote_owner = $r[0];
}

View file

@ -210,8 +210,9 @@ function notifier_run(&$argv, &$argc){
intval($uid)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
$owner = $r[0];

View file

@ -143,8 +143,9 @@ function onepoll_run(&$argv, &$argc){
$r = q("SELECT `contact`.*, `user`.`page-flags` FROM `contact` INNER JOIN `user` on `contact`.`uid` = `user`.`uid` WHERE `user`.`uid` = %d AND `contact`.`self` = 1 LIMIT 1",
intval($importer_uid)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
$importer = $r[0];

View file

@ -36,9 +36,9 @@ function auto_redir(&$a, $contact_nick) {
dbesc($nurl)
);
if((! dbm::is_result($r)) || $r[0]['id'] == remote_user())
if ((! dbm::is_result($r)) || $r[0]['id'] == remote_user()) {
return;
}
$r = q("SELECT * FROM contact WHERE nick = '%s'
AND network = '%s' AND uid = %d AND url LIKE '%%%s%%' LIMIT 1",
@ -48,8 +48,9 @@ function auto_redir(&$a, $contact_nick) {
dbesc($baseurl)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
$cid = $r[0]['id'];

View file

@ -2000,8 +2000,9 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) {
intval($item),
intval($uid)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return false;
}
q("UPDATE `item` SET `file` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc(str_replace($pattern,'',$r[0]['file'])),
@ -2023,8 +2024,8 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) {
if (! dbm::is_result($r)) {
$saved = get_pconfig($uid,'system','filetags');
set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved));
}
return true;
}

View file

@ -43,8 +43,9 @@ function crepair_post(&$a) {
);
}
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
$contact = $r[0];

View file

@ -284,8 +284,9 @@ function dfrn_notify_content(&$a) {
dbesc($a->argv[1])
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
$status = 1;
}
logger("Remote rino version: ".$rino_remote." for ".$r[0]["url"], LOGGER_DEBUG);

View file

@ -284,8 +284,9 @@ function dfrn_poll_post(&$a) {
dbesc($challenge)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$type = $r[0]['type'];
$last_update = $r[0]['last_update'];
@ -319,8 +320,9 @@ function dfrn_poll_post(&$a) {
$r = q("SELECT * FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1");
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$contact = $r[0];
$owner_uid = $r[0]['uid'];

View file

@ -842,9 +842,10 @@ function dfrn_request_content(&$a) {
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval($a->profile['uid'])
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
$mail_disabled = 1;
}
}
// "coming soon" is disabled for now
//$emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));

View file

@ -16,8 +16,9 @@ function ignored_init(&$a) {
intval(local_user()),
intval($message_id)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
if(! intval($r[0]['ignored']))
$ignored = 1;

View file

@ -464,8 +464,9 @@ function item_post(&$a) {
intval($profile_uid)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
continue;
}
$r = q("UPDATE `photo` SET `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s'
WHERE `resource-id` = '%s' AND `uid` = %d AND `album` = '%s' ",

View file

@ -21,8 +21,9 @@ function lockview_content(&$a) {
dbesc($type),
intval($item_id)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$item = $r[0];
call_hooks('lockview_content', $item);

View file

@ -56,8 +56,9 @@ function manage_post(&$a) {
);
}
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);

View file

@ -27,8 +27,9 @@ function match_content(&$a) {
$r = q("SELECT `pub_keywords`, `prv_keywords` FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
intval(local_user())
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
if(! $r[0]['pub_keywords'] && (! $r[0]['prv_keywords'])) {
notice( t('No keywords to match. Please add keywords to your default profile.') . EOL);
return;

View file

@ -12,8 +12,9 @@ function modexp_init(&$a) {
dbesc($nick)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$lines = explode("\n",$r[0]['spubkey']);
unset($lines[0]);

View file

@ -23,8 +23,9 @@ function post_post(&$a) {
AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nickname)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
http_status_exit(500);
}
$importer = $r[0];
}

View file

@ -117,8 +117,9 @@ function pubsub_post(&$a) {
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nick)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
hub_post_return();
}
$importer = $r[0];

View file

@ -34,8 +34,9 @@ function receive_post(&$a) {
$r = q("SELECT * FROM `user` WHERE `guid` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($guid)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
http_status_exit(500);
}
$importer = $r[0];
}

View file

@ -31,8 +31,9 @@ function salmon_post(&$a) {
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' AND `account_expired` = 0 AND `account_removed` = 0 LIMIT 1",
dbesc($nick)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
http_status_exit(500);
}
$importer = $r[0];

View file

@ -752,8 +752,9 @@ function settings_content(&$a) {
$settings_addons = "";
$r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
$settings_addons = t('No Plugin settings configured');
}
call_hooks('plugin_settings', $settings_addons);

View file

@ -18,8 +18,9 @@ function starred_init(&$a) {
intval(local_user()),
intval($message_id)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
if(! intval($r[0]['starred']))
$starred = 1;

View file

@ -41,8 +41,9 @@ function subthread_content(&$a) {
intval($item['contact-id']),
intval($item['uid'])
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
if(! $r[0]['self'])
$remote_owner = $r[0];
}

View file

@ -19,8 +19,9 @@ function tagrm_post(&$a) {
intval(local_user())
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
}
$arr = explode(',', $r[0]['tag']);
for($x = 0; $x < count($arr); $x ++) {
@ -68,8 +69,9 @@ function tagrm_content(&$a) {
intval(local_user())
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
}
$arr = explode(',', $r[0]['tag']);

View file

@ -16,8 +16,9 @@ function viewcontacts_init(&$a) {
dbesc($nick)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
return;
}
$a->data['user'] = $r[0];
$a->profile_uid = $r[0]['uid'];

View file

@ -21,8 +21,9 @@ function xrd_init(&$a) {
$r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
dbesc($name)
);
if(! dbm::is_result($r))
if (! dbm::is_result($r)) {
killme();
}
$salmon_key = salmon_key($r[0]['spubkey']);