mirror of
https://github.com/friendica/friendica
synced 2025-04-26 12:30:11 +00:00
converted more to dbm::is_result() + added braces/space
Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
0e58bf6675
commit
51716957b2
13 changed files with 61 additions and 41 deletions
|
@ -704,7 +704,7 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
|
|||
// If its a post from myself then tag the thread as "mention"
|
||||
logger("item_store: Checking if parent ".$parent_id." has to be tagged as mention for user ".$arr['uid'], LOGGER_DEBUG);
|
||||
$u = q("SELECT `nickname` FROM `user` WHERE `uid` = %d", intval($arr['uid']));
|
||||
if (count($u)) {
|
||||
if (dbm::is_result($u)) {
|
||||
$a = get_app();
|
||||
$self = normalise_link(App::get_baseurl() . '/profile/' . $u[0]['nickname']);
|
||||
logger("item_store: 'myself' is ".$self." for parent ".$parent_id." checking against ".$arr['author-link']." and ".$arr['owner-link'], LOGGER_DEBUG);
|
||||
|
@ -1188,19 +1188,22 @@ function tag_deliver($uid,$item_id) {
|
|||
$u = q("select * from user where uid = %d limit 1",
|
||||
intval($uid)
|
||||
);
|
||||
if (! count($u))
|
||||
|
||||
if (! dbm::is_result($u)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
|
||||
$prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false);
|
||||
|
||||
|
||||
$i = q("select * from item where id = %d and uid = %d limit 1",
|
||||
$i = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($item_id),
|
||||
intval($uid)
|
||||
);
|
||||
if (! count($i))
|
||||
if (! dbm::is_result($i)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$item = $i[0];
|
||||
|
||||
|
@ -1298,12 +1301,13 @@ function tgroup_check($uid,$item) {
|
|||
if (($item['wall']) || ($item['origin']) || ($item['uri'] != $item['parent-uri']))
|
||||
return false;
|
||||
|
||||
|
||||
$u = q("select * from user where uid = %d limit 1",
|
||||
/// @TODO Encapsulate this or find it encapsulated and replace all occurrances
|
||||
$u = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
|
||||
intval($uid)
|
||||
);
|
||||
if (! count($u))
|
||||
if (! dbm::is_result($u)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$community_page = (($u[0]['page-flags'] == PAGE_COMMUNITY) ? true : false);
|
||||
$prvgroup = (($u[0]['page-flags'] == PAGE_PRVGROUP) ? true : false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue