From 98b727029570b96febd0c5046b688cab1a9bb882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 20 Dec 2016 10:10:33 +0100 Subject: [PATCH] Coding convention applied: - space between "if" and brace - curly braces on conditional blocks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Conflicts: include/lock.php --- boot.php | 2 +- include/dfrn.php | 6 ++++-- include/follow.php | 2 +- include/group.php | 5 +++-- include/like.php | 3 ++- include/lock.php | 2 +- include/notifier.php | 3 ++- include/onepoll.php | 3 ++- include/redir.php | 7 ++++--- include/socgraph.php | 2 +- include/text.php | 7 ++++--- mod/allfriends.php | 2 +- mod/attach.php | 4 ++-- mod/common.php | 2 +- mod/community.php | 2 +- mod/contactgroup.php | 2 +- mod/contacts.php | 4 ++-- mod/content.php | 2 +- mod/crepair.php | 7 ++++--- mod/delegate.php | 2 +- mod/dfrn_confirm.php | 6 +++--- mod/dfrn_notify.php | 7 ++++--- mod/dfrn_poll.php | 10 ++++++---- mod/dfrn_request.php | 5 +++-- mod/fsuggest.php | 4 ++-- mod/group.php | 4 ++-- mod/ignored.php | 3 ++- mod/item.php | 5 +++-- mod/lockview.php | 3 ++- mod/lostpass.php | 4 ++-- mod/manage.php | 3 ++- mod/match.php | 3 ++- mod/message.php | 2 +- mod/modexp.php | 3 ++- mod/network.php | 4 ++-- mod/poke.php | 2 +- mod/post.php | 3 ++- mod/profiles.php | 6 +++--- mod/profperm.php | 2 +- mod/pubsub.php | 9 +++++---- mod/receive.php | 3 ++- mod/salmon.php | 5 +++-- mod/search.php | 4 ++-- mod/settings.php | 5 +++-- mod/starred.php | 3 ++- mod/subthread.php | 3 ++- mod/suggest.php | 2 +- mod/tagrm.php | 6 ++++-- mod/viewcontacts.php | 3 ++- mod/wall_attach.php | 4 ++-- mod/wall_upload.php | 2 +- mod/wallmessage.php | 4 ++-- mod/xrd.php | 3 ++- 53 files changed, 117 insertions(+), 87 deletions(-) diff --git a/boot.php b/boot.php index b282f8d48e..c500468e5f 100644 --- a/boot.php +++ b/boot.php @@ -1028,7 +1028,7 @@ class App { } else { $r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like '%%/%s'", $common_filename); - if(! dbm::is_result($r)){ + if (! dbm::is_result($r)) { $this->cached_profile_image[$avatar_image] = $avatar_image; } else { $this->cached_profile_picdate[$common_filename] = "?rev=".urlencode($r[0]['picdate']); diff --git a/include/dfrn.php b/include/dfrn.php index 6451b8521b..689c5c2832 100644 --- a/include/dfrn.php +++ b/include/dfrn.php @@ -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'); diff --git a/include/follow.php b/include/follow.php index d7066bcb55..e67beb84c2 100644 --- a/include/follow.php +++ b/include/follow.php @@ -254,7 +254,7 @@ function new_contact($uid,$url,$interactive = false) { intval($uid) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $result['message'] .= t('Unable to retrieve contact information.') . EOL; return $result; } diff --git a/include/group.php b/include/group.php index 2c90330686..67712aae7c 100644 --- a/include/group.php +++ b/include/group.php @@ -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; } diff --git a/include/like.php b/include/like.php index 8239633e6a..8223cf3626 100644 --- a/include/like.php +++ b/include/like.php @@ -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]; } diff --git a/include/lock.php b/include/lock.php index d49fda343f..b3d488a357 100644 --- a/include/lock.php +++ b/include/lock.php @@ -23,7 +23,7 @@ function lock_function($fn_name, $block = true, $wait_sec = 2, $timeout = 30) { ); $got_lock = true; } - elseif(! dbm::is_result($r)) { + elseif (! dbm::is_result($r)) { /// @TODO the Boolean value for count($r) should be equivalent to the Boolean value of $r q("INSERT INTO `locks` (`name`, `created`, `locked`) VALUES ('%s', '%s', 1)", dbesc($fn_name), diff --git a/include/notifier.php b/include/notifier.php index c4e7df47ac..8823834c1d 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -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]; diff --git a/include/onepoll.php b/include/onepoll.php index 2834036665..d92cb915b6 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -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]; diff --git a/include/redir.php b/include/redir.php index 8d65089de7..d8bb764396 100644 --- a/include/redir.php +++ b/include/redir.php @@ -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']; diff --git a/include/socgraph.php b/include/socgraph.php index c5fc31581e..598eb37373 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -330,7 +330,7 @@ function poco_check($profile_url, $name, $network, $profile_photo, $about, $loca intval($gcid), intval($zcid) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { q("INSERT INTO `glink` (`cid`,`uid`,`gcid`,`zcid`, `updated`) VALUES (%d,%d,%d,%d, '%s') ", intval($cid), intval($uid), diff --git a/include/text.php b/include/text.php index a2c474d32e..05801d024c 100644 --- a/include/text.php +++ b/include/text.php @@ -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'])), @@ -2020,11 +2021,11 @@ function file_tag_unsave_file($uid,$item,$file,$cat = false) { //$r = q("select file from item where uid = %d and deleted = 0 " . file_tag_file_query('item',$file,(($cat) ? 'category' : 'file')), //); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $saved = get_pconfig($uid,'system','filetags'); set_pconfig($uid,'system','filetags',str_replace($pattern,'',$saved)); - } + return true; } diff --git a/mod/allfriends.php b/mod/allfriends.php index 1f2c043ced..e4f067eaf7 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -39,7 +39,7 @@ function allfriends_content(&$a) { $r = all_friends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $o .= t('No friends to display.'); return $o; } diff --git a/mod/attach.php b/mod/attach.php index 274acfc2be..94cb75a386 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -16,7 +16,7 @@ function attach_init(&$a) { $r = q("SELECT * FROM `attach` WHERE `id` = %d LIMIT 1", intval($item_id) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Item was not found.'). EOL); return; } @@ -29,7 +29,7 @@ function attach_init(&$a) { dbesc($item_id) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/common.php b/mod/common.php index 9f9379be57..9781d1607c 100644 --- a/mod/common.php +++ b/mod/common.php @@ -94,7 +94,7 @@ function common_content(&$a) { $r = common_friends_zcid($uid, $zcid, $a->pager['start'], $a->pager['itemspage']); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { return $o; } diff --git a/mod/community.php b/mod/community.php index 40d4016f33..c8f04d8bd6 100644 --- a/mod/community.php +++ b/mod/community.php @@ -71,7 +71,7 @@ function community_content(&$a, $update = 0) { $r = community_getitems($a->pager['start'], $a->pager['itemspage']); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { info( t('No results.') . EOL); return $o; } diff --git a/mod/contactgroup.php b/mod/contactgroup.php index 4456db2f53..0671ff42ae 100644 --- a/mod/contactgroup.php +++ b/mod/contactgroup.php @@ -24,7 +24,7 @@ function contactgroup_content(&$a) { intval($a->argv[1]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { killme(); } diff --git a/mod/contacts.php b/mod/contacts.php index 37cc09cab6..22e08b8c96 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -19,7 +19,7 @@ function contacts_init(&$a) { intval(local_user()), intval($contact_id) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $contact_id = 0; } } @@ -169,7 +169,7 @@ function contacts_post(&$a) { intval($profile_id), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Could not locate selected profile.') . EOL); return; } diff --git a/mod/content.php b/mod/content.php index bc98f7e51d..332a35f006 100644 --- a/mod/content.php +++ b/mod/content.php @@ -113,7 +113,7 @@ function content_content(&$a, $update = 0) { intval($group), intval($_SESSION['uid']) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { if($update) killme(); notice( t('No such group') . EOL ); diff --git a/mod/crepair.php b/mod/crepair.php index b4275f6baa..66faadb06a 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -14,7 +14,7 @@ function crepair_init(&$a) { intval(local_user()), intval($contact_id) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $contact_id = 0; } } @@ -43,8 +43,9 @@ function crepair_post(&$a) { ); } - if(! dbm::is_result($r)) + if (! dbm::is_result($r)) { return; + } $contact = $r[0]; @@ -110,7 +111,7 @@ function crepair_content(&$a) { ); } - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Contact not found.') . EOL); return; } diff --git a/mod/delegate.php b/mod/delegate.php index 343e1e3038..0ba5dd39c1 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -97,7 +97,7 @@ function delegate_content(&$a) { dbesc(NETWORK_DFRN) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('No potential page delegates located.') . EOL); return; } diff --git a/mod/dfrn_confirm.php b/mod/dfrn_confirm.php index 7097b0117a..69d708f7fc 100644 --- a/mod/dfrn_confirm.php +++ b/mod/dfrn_confirm.php @@ -121,7 +121,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { intval($uid) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('Contact not found in DB.'); notice( t('Contact not found.') . EOL ); notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL ); @@ -553,7 +553,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1", dbesc($node)); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $message = sprintf(t('No user record found for \'%s\' '), $node); xml_status(3,$message); // failure // NOTREACHED @@ -640,7 +640,7 @@ function dfrn_confirm_post(&$a,$handsfree = null) { dbesc($dfrn_pubkey), intval($dfrn_record) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $message = t('Unable to set your contact credentials on our system.'); xml_status(3,$message); } diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index dfa2af18ce..ca12211583 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -42,7 +42,7 @@ function dfrn_notify_post(&$a) { dbesc($dfrn_id), dbesc($challenge) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('dfrn_notify: could not match challenge to dfrn_id ' . $dfrn_id . ' challenge=' . $challenge); xml_status(3); } @@ -88,7 +88,7 @@ function dfrn_notify_post(&$a) { dbesc($a->argv[1]) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('dfrn_notify: contact not found for dfrn_id ' . $dfrn_id); xml_status(3); //NOTREACHED @@ -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); diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index 7c3fced12f..0c55af2a89 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -126,7 +126,7 @@ function dfrn_poll_init(&$a) { $r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1", dbesc($sec) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { xml_status(3, 'No ticket'); // NOTREACHED } @@ -223,7 +223,7 @@ function dfrn_poll_post(&$a) { $r = q("SELECT * FROM `profile_check` WHERE `sec` = '%s' ORDER BY `expire` DESC LIMIT 1", dbesc($sec) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { xml_status(3, 'No ticket'); // NOTREACHED } @@ -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']; diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php index 24a1dc0725..7a8021784d 100644 --- a/mod/dfrn_request.php +++ b/mod/dfrn_request.php @@ -371,7 +371,7 @@ function dfrn_request_post(&$a) { intval($uid) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('This account has not been configured for email. Request failed.') . EOL); return; } @@ -842,8 +842,9 @@ 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 diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 1d56f45736..4370952ca1 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -16,7 +16,7 @@ function fsuggest_post(&$a) { intval($contact_id), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Contact not found.') . EOL); return; } @@ -88,7 +88,7 @@ function fsuggest_content(&$a) { intval($contact_id), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Contact not found.') . EOL); return; } diff --git a/mod/group.php b/mod/group.php index 33b819ed5d..c4854a602d 100644 --- a/mod/group.php +++ b/mod/group.php @@ -43,7 +43,7 @@ function group_post(&$a) { intval($a->argv[1]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Group not found.') . EOL ); goaway(App::get_baseurl() . '/contacts'); return; // NOTREACHED @@ -136,7 +136,7 @@ function group_content(&$a) { intval($a->argv[1]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Group not found.') . EOL ); goaway(App::get_baseurl() . '/contacts'); } diff --git a/mod/ignored.php b/mod/ignored.php index eec204c708..4aeeb21e6b 100644 --- a/mod/ignored.php +++ b/mod/ignored.php @@ -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; diff --git a/mod/item.php b/mod/item.php index c741f16144..7bee5f3eae 100644 --- a/mod/item.php +++ b/mod/item.php @@ -112,7 +112,7 @@ function item_post(&$a) { } } - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Unable to locate original post.') . EOL); if(x($_REQUEST,'return')) goaway($return_path); @@ -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' ", diff --git a/mod/lockview.php b/mod/lockview.php index c806fc3175..68b5d30cfe 100644 --- a/mod/lockview.php +++ b/mod/lockview.php @@ -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); diff --git a/mod/lostpass.php b/mod/lostpass.php index 122024d26b..92e64f7e2e 100644 --- a/mod/lostpass.php +++ b/mod/lostpass.php @@ -15,7 +15,7 @@ function lostpass_post(&$a) { dbesc($loginame) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('No valid account found.') . EOL); goaway(z_root()); } @@ -87,7 +87,7 @@ function lostpass_content(&$a) { $r = q("SELECT * FROM `user` WHERE `pwdreset` = '%s' LIMIT 1", dbesc($hash) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $o = t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."); return $o; } diff --git a/mod/manage.php b/mod/manage.php index 4a4f0a9e37..2138595bee 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -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']); diff --git a/mod/match.php b/mod/match.php index f7fe325b38..69bf3c1101 100644 --- a/mod/match.php +++ b/mod/match.php @@ -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; diff --git a/mod/message.php b/mod/message.php index 0a2c797b42..b0d0ba95ca 100644 --- a/mod/message.php +++ b/mod/message.php @@ -381,7 +381,7 @@ function message_content(&$a) { $r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { info( t('No messages.') . EOL); return $o; } diff --git a/mod/modexp.php b/mod/modexp.php index d1dabb101b..3729e3236c 100644 --- a/mod/modexp.php +++ b/mod/modexp.php @@ -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]); diff --git a/mod/network.php b/mod/network.php index 057ef79145..c040a547a4 100644 --- a/mod/network.php +++ b/mod/network.php @@ -126,7 +126,7 @@ function network_init(&$a) { intval(local_user()), dbesc($search) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { q("INSERT INTO `search` ( `uid`,`term` ) VALUES ( %d, '%s') ", intval(local_user()), dbesc($search) @@ -463,7 +463,7 @@ function network_content(&$a, $update = 0) { intval($group), intval($_SESSION['uid']) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { if($update) killme(); notice( t('No such group') . EOL ); diff --git a/mod/poke.php b/mod/poke.php index 0619a34e07..fea5c0c0d8 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -52,7 +52,7 @@ function poke_init(&$a) { intval($uid) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('poke: no contact ' . $contact_id); return; } diff --git a/mod/post.php b/mod/post.php index 76282d29a5..a8d345ecb6 100644 --- a/mod/post.php +++ b/mod/post.php @@ -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]; } diff --git a/mod/profiles.php b/mod/profiles.php index a5f5609b6b..44067032ea 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -15,7 +15,7 @@ function profiles_init(&$a) { intval($a->argv[2]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Profile not found.') . EOL); goaway('profiles'); return; // NOTREACHED @@ -130,7 +130,7 @@ function profiles_init(&$a) { intval($a->argv[1]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Profile not found.') . EOL); killme(); return; @@ -613,7 +613,7 @@ function profiles_content(&$a) { intval($a->argv[1]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Profile not found.') . EOL); return; } diff --git a/mod/profperm.php b/mod/profperm.php index 1c37f84ab2..aa610d3a93 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -52,7 +52,7 @@ function profperm_content(&$a) { intval($a->argv[1]), intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('Invalid profile identifier.') . EOL ); return; } diff --git a/mod/pubsub.php b/mod/pubsub.php index ddda7ec228..ea7e1000ba 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -47,7 +47,7 @@ function pubsub_init(&$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)) { logger('pubsub: local account not found: ' . $nick); hub_return(false, ''); } @@ -62,7 +62,7 @@ function pubsub_init(&$a) { intval($contact_id), intval($owner['uid']) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('pubsub: contact '.$contact_id.' not found.'); hub_return(false, ''); } @@ -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]; @@ -131,7 +132,7 @@ function pubsub_post(&$a) { dbesc(NETWORK_FEED) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('pubsub: no contact record for "'.$nick.' ('.$contact_id.')" - ignored. '.$xml); hub_post_return(); } diff --git a/mod/receive.php b/mod/receive.php index dd4e61ae4f..99e3648e91 100644 --- a/mod/receive.php +++ b/mod/receive.php @@ -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]; } diff --git a/mod/salmon.php b/mod/salmon.php index 78cdc09328..ff5856a946 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -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]; @@ -150,7 +151,7 @@ function salmon_post(&$a) { dbesc(normalise_link($author_link)), intval($importer['uid']) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('mod-salmon: Author unknown to us.'); if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) { $result = new_contact($importer['uid'],$author_link); diff --git a/mod/search.php b/mod/search.php index d36cc8fcb7..c19bb27673 100644 --- a/mod/search.php +++ b/mod/search.php @@ -53,7 +53,7 @@ function search_init(&$a) { intval(local_user()), dbesc($search) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { q("INSERT INTO `search` (`uid`,`term`) VALUES ( %d, '%s')", intval(local_user()), dbesc($search) @@ -219,7 +219,7 @@ function search_content(&$a) { intval($a->pager['start']), intval($a->pager['itemspage'])); } - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { info( t('No results.') . EOL); return $o; } diff --git a/mod/settings.php b/mod/settings.php index 41783815e7..e7fd55e944 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -225,7 +225,7 @@ function settings_post(&$a) { $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1", intval(local_user()) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { q("INSERT INTO `mailacct` (`uid`) VALUES (%d)", intval(local_user()) ); @@ -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); diff --git a/mod/starred.php b/mod/starred.php index 5acbb393ef..0e5e75d167 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -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; diff --git a/mod/subthread.php b/mod/subthread.php index dc014047a0..66072bcc88 100644 --- a/mod/subthread.php +++ b/mod/subthread.php @@ -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]; } diff --git a/mod/suggest.php b/mod/suggest.php index 080decc71a..73f5ffe4b2 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -67,7 +67,7 @@ function suggest_content(&$a) { $r = suggestion_query(local_user()); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $o .= t('No suggestions available. If this is a new site, please try again in 24 hours.'); return $o; } diff --git a/mod/tagrm.php b/mod/tagrm.php index 08d390a70b..d6e57d36a9 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -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']); diff --git a/mod/viewcontacts.php b/mod/viewcontacts.php index c9f465676c..3fd5d79e1b 100644 --- a/mod/viewcontacts.php +++ b/mod/viewcontacts.php @@ -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']; diff --git a/mod/wall_attach.php b/mod/wall_attach.php index 80fc1c6e79..525d3509c1 100644 --- a/mod/wall_attach.php +++ b/mod/wall_attach.php @@ -12,7 +12,7 @@ function wall_attach_post(&$a) { $r = q("SELECT `user`.*, `contact`.`id` FROM `user` LEFT JOIN `contact` on `user`.`uid` = `contact`.`uid` WHERE `user`.`nickname` = '%s' AND `user`.`blocked` = 0 and `contact`.`self` = 1 LIMIT 1", dbesc($nick) ); - if(! dbm::is_result($r)){ + if (! dbm::is_result($r)) { if ($r_json) { echo json_encode(array('error'=>t('Invalid request.'))); killme(); @@ -168,7 +168,7 @@ function wall_attach_post(&$a) { dbesc($hash) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { $msg = t('File upload failed.'); if ($r_json) { echo json_encode(array('error'=>$msg)); diff --git a/mod/wall_upload.php b/mod/wall_upload.php index e277290985..eb2a92323a 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -15,7 +15,7 @@ function wall_upload_post(&$a, $desktopmode = true) { dbesc($nick) ); - if(! dbm::is_result($r)){ + if (! dbm::is_result($r)) { if ($r_json) { echo json_encode(array('error'=>t('Invalid request.'))); killme(); diff --git a/mod/wallmessage.php b/mod/wallmessage.php index 03a0b7a16f..afe25cbe8b 100644 --- a/mod/wallmessage.php +++ b/mod/wallmessage.php @@ -22,7 +22,7 @@ function wallmessage_post(&$a) { dbesc($recipient) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { logger('wallmessage: no recipient'); return; } @@ -91,7 +91,7 @@ function wallmessage_content(&$a) { dbesc($recipient) ); - if(! dbm::is_result($r)) { + if (! dbm::is_result($r)) { notice( t('No recipient.') . EOL); logger('wallmessage: no recipient'); return; diff --git a/mod/xrd.php b/mod/xrd.php index 576ae9b38f..290c524a7d 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -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']);