$item = Item::selectFirst([], ['id' => $item_id]);
- if (!$item_id || !DBA::is_result($item)) {
+ if (!$item_id || !DBA::isResult($item)) {
logger('tagger: no item ' . $item_id);
return;
}
$r = q("select `nickname`,`blocktags` from user where uid = %d limit 1",
intval($owner_uid)
);
- if (DBA::is_result($r)) {
+ if (DBA::isResult($r)) {
$owner_nick = $r[0]['nickname'];
$blocktags = $r[0]['blocktags'];
}
$r = q("select * from contact where self = 1 and uid = %d limit 1",
intval(local_user())
);
- if (DBA::is_result($r)) {
+ if (DBA::isResult($r)) {
$contact = $r[0];
} else {
logger('tagger: no contact_id');
$t = q("SELECT count(tid) as tcount FROM term WHERE oid=%d AND term='%s'",
intval($item['id']),
- dbesc($term)
+ DBA::escape($term)
);
if (!$blocktags && $t[0]['tcount'] == 0) {
intval($item['id']),
$term_objtype,
TERM_HASHTAG,
- dbesc($term),
- dbesc(System::baseUrl() . '/search?tag=' . $term),
+ DBA::escape($term),
+ DBA::escape(System::baseUrl() . '/search?tag=' . $term),
intval($owner_uid)
);
}
// if the original post is on this site, update it.
$original_item = Item::selectFirst(['tag', 'id', 'uid'], ['origin' => true, 'uri' => $item['uri']]);
- if (DBA::is_result($original_item)) {
+ if (DBA::isResult($original_item)) {
$x = q("SELECT `blocktags` FROM `user` WHERE `uid`=%d LIMIT 1",
intval($original_item['uid'])
);
$t = q("SELECT COUNT(`tid`) AS `tcount` FROM `term` WHERE `oid`=%d AND `term`='%s'",
intval($original_item['id']),
- dbesc($term)
+ DBA::escape($term)
);
- if (DBA::is_result($x) && !$x[0]['blocktags'] && $t[0]['tcount'] == 0){
+ if (DBA::isResult($x) && !$x[0]['blocktags'] && $t[0]['tcount'] == 0){
q("INSERT INTO term (`oid`, `otype`, `type`, `term`, `url`, `uid`) VALUE (%d, %d, %d, '%s', '%s', %d)",
intval($original_item['id']),
$term_objtype,
TERM_HASHTAG,
- dbesc($term),
- dbesc(System::baseUrl() . '/search?tag=' . $term),
+ DBA::escape($term),
+ DBA::escape(System::baseUrl() . '/search?tag=' . $term),
intval($owner_uid)
);
}