From fd8c9a9dacce946fd4f5698601c03cb59902f7bf Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 6 May 2015 13:02:02 +0200 Subject: [PATCH 1/3] avoid some contacts from profile match listing --- mod/match.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/match.php b/mod/match.php index 926df1dff..96a6efc30 100644 --- a/mod/match.php +++ b/mod/match.php @@ -48,6 +48,11 @@ function match_content(&$a) { $tpl = get_markup_template('match.tpl'); foreach($j->results as $jj) { + $match_nurl = str_replace(array('https:','//www.'), array('http:','//'), $jj->url); + $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1", + intval(local_user()), + $match_nurl); + if (!count($match)) { $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url; $o .= replace_macros($tpl,array( @@ -59,6 +64,7 @@ function match_content(&$a) { '$connlnk' => $connlnk, '$tags' => $jj->tags )); + } } } else { From 0b8b1fdef328c4e3a0320756ef3d7a538a628553 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Wed, 6 May 2015 16:14:27 +0200 Subject: [PATCH 2/3] add procy_url around the profile images --- mod/match.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/match.php b/mod/match.php index 96a6efc30..af4b84790 100644 --- a/mod/match.php +++ b/mod/match.php @@ -58,7 +58,7 @@ function match_content(&$a) { $o .= replace_macros($tpl,array( '$url' => zrl($jj->url), '$name' => $jj->name, - '$photo' => $jj->photo, + '$photo' => proxy_url($jj->photo), '$inttxt' => ' ' . t('is interested in:'), '$conntxt' => t('Connect'), '$connlnk' => $connlnk, From 9244e8727d4f57c304624246f7d4f578def1a813 Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Sun, 10 May 2015 09:10:27 +0200 Subject: [PATCH 3/3] dbesc and normalise_link --- mod/match.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/match.php b/mod/match.php index af4b84790..aa0a69fc9 100644 --- a/mod/match.php +++ b/mod/match.php @@ -1,5 +1,5 @@ results as $jj) { - $match_nurl = str_replace(array('https:','//www.'), array('http:','//'), $jj->url); + $match_nurl = normalise_link($jj->url); $match = q("SELECT `nurl` FROM `contact` WHERE `uid` = '%d' AND nurl='%s' LIMIT 1", intval(local_user()), - $match_nurl); + dbesc($match_nurl)); if (!count($match)) { $connlnk = $a->get_baseurl() . '/follow/?url=' . $jj->url;