Browse Source

Coding convention applied:

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

Signed-off-by: Roland Häder <roland@mxchange.org>
pull/3043/head
Roland Häder 5 years ago
parent
commit
fb676335db
  1. 2
      boot.php
  2. 6
      include/dfrn.php
  3. 2
      include/follow.php
  4. 5
      include/group.php
  5. 3
      include/like.php
  6. 2
      include/lock.php
  7. 3
      include/notifier.php
  8. 3
      include/onepoll.php
  9. 7
      include/redir.php
  10. 2
      include/socgraph.php
  11. 7
      include/text.php
  12. 2
      mod/allfriends.php
  13. 4
      mod/attach.php
  14. 2
      mod/common.php
  15. 2
      mod/community.php
  16. 2
      mod/contactgroup.php
  17. 4
      mod/contacts.php
  18. 2
      mod/content.php
  19. 7
      mod/crepair.php
  20. 2
      mod/delegate.php
  21. 6
      mod/dfrn_confirm.php
  22. 7
      mod/dfrn_notify.php
  23. 10
      mod/dfrn_poll.php
  24. 5
      mod/dfrn_request.php
  25. 4
      mod/fsuggest.php
  26. 4
      mod/group.php
  27. 3
      mod/ignored.php
  28. 5
      mod/item.php
  29. 3
      mod/lockview.php
  30. 4
      mod/lostpass.php
  31. 3
      mod/manage.php
  32. 3
      mod/match.php
  33. 2
      mod/message.php
  34. 3
      mod/modexp.php
  35. 4
      mod/network.php
  36. 2
      mod/poke.php
  37. 3
      mod/post.php
  38. 6
      mod/profiles.php
  39. 2
      mod/profperm.php
  40. 9
      mod/pubsub.php
  41. 3
      mod/receive.php
  42. 5
      mod/salmon.php
  43. 4
      mod/search.php
  44. 5
      mod/settings.php
  45. 3
      mod/starred.php
  46. 3
      mod/subthread.php
  47. 2
      mod/suggest.php
  48. 6
      mod/tagrm.php
  49. 3
      mod/viewcontacts.php
  50. 4
      mod/wall_attach.php
  51. 2
      mod/wall_upload.php
  52. 4
      mod/wallmessage.php
  53. 3
      mod/xrd.php

2
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']);

6
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');

2
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;
}

5
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;
}

3
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];
}

2
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),

3
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];

3
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];

7
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'];

2
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),

7
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;
}

2
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;
}

4
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;
}

2
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;
}

2
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;
}

2
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();
}

4
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;
}

2
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 );

7
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;
}

2
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;
}

6
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);
}

7
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);

10
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'];

5
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

4
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;
}

4
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');
}

3
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;

5
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' ",

3
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);

4
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;
}

3
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']);

3
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;

2
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;
}

3
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]);

4
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 );

2
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;
}

3
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];
}

6
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;
}

2
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;
}

9
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();
}

3
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];
}

5
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);

4
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;
}

5
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);

3
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;

3
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];
}

2
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;
}

6
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']);

3
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'];

4
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));

2
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();

4
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;

3
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']);

Loading…
Cancel
Save