- $name = '';
- $id = '';
-
- if (intval($_GET['c'])) {
- $r = q("SELECT `id`,`name` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
- intval($_GET['c']),
- intval(local_user())
- );
- if (DBA::isResult($r)) {
- $name = $item['name'];
- $id = $item['id'];
- }
+ if (empty($_GET['c'])) {
+ return;
+ }
+
+ $contact = DBA::selectFirst('contact', ['id', 'name'], ['id' => $_GET['c'], 'uid' => local_user()]);
+ if (!DBA::isResult($contact)) {
+ return;