From 7ed73a06ab312361919a65f581076a298c9336df Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 1 Dec 2015 23:51:34 +0100 Subject: [PATCH] Solved a problem with author links that are different from what is provided in the contact --- mod/contacts.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mod/contacts.php b/mod/contacts.php index 270541f4a0..99b1c37c49 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -899,8 +899,10 @@ function contact_posts($a, $contact_id) { if(get_config('system', 'old_pager')) { $r = q("SELECT COUNT(*) AS `total` FROM `item` - WHERE `item`.`uid` = %d AND (`author-link` = '%s')", - intval(local_user()), dbesc($contact["url"])); + WHERE `item`.`uid` = %d AND `author-link` IN ('%s', '%s')", + intval(local_user()), + dbesc(normalise_link($contact["url"])), + dbesc(str_replace("http://", "https://", $contact["url"]))); $a->set_pager_total($r[0]['total']); } @@ -910,15 +912,19 @@ function contact_posts($a, $contact_id) { `owner-link` AS `url`, `owner-avatar` AS `thumb` FROM `item` FORCE INDEX (uid_contactid_created) WHERE `item`.`uid` = %d AND `contact-id` = %d - AND (`author-link` = '%s') + AND `author-link` IN ('%s', '%s') ORDER BY `item`.`created` DESC LIMIT %d, %d", intval(local_user()), intval($contact_id), - dbesc($contact["url"]), + dbesc(normalise_link($contact["url"])), + dbesc(str_replace("http://", "https://", $contact["url"])), intval($a->pager['start']), intval($a->pager['itemspage']) ); + if (!$r) + $o = $contact["url"]." - ".$contact_id; + $tab_str = contacts_tab($a, $contact_id, 1); $header = $contact["name"];