From cef77ce5bb296829576f5d7a515b56a8b18f99eb Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 22 Jun 2016 19:22:59 -0700 Subject: the xchan_query wasn't fully optimised as we were comparing quoted and unquoted strings when looking for duplicates --- include/text.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/text.php b/include/text.php index 4f28c6dbc..12b6b1137 100644 --- a/include/text.php +++ b/include/text.php @@ -2089,9 +2089,9 @@ function xchan_query(&$items,$abook = true,$effective_uid = 0) { } foreach($items as $item) { - if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr))) + if($item['owner_xchan'] && (! in_array("'" . dbesc($item['owner_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['owner_xchan']) . "'"; - if($item['author_xchan'] && (! in_array($item['author_xchan'],$arr))) + if($item['author_xchan'] && (! in_array("'" . dbesc($item['author_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['author_xchan']) . "'"; } } @@ -2124,9 +2124,9 @@ function xchan_mail_query(&$item) { $arr = array(); $chans = null; if($item) { - if($item['from_xchan'] && (! in_array($item['from_xchan'],$arr))) + if($item['from_xchan'] && (! in_array("'" . dbesc($item['from_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['from_xchan']) . "'"; - if($item['to_xchan'] && (! in_array($item['to_xchan'],$arr))) + if($item['to_xchan'] && (! in_array("'" . dbesc($item['to_xchan']) . "'",$arr))) $arr[] = "'" . dbesc($item['to_xchan']) . "'"; } -- cgit v1.2.3