From 63f66a5a93661cfc327449561a2150aa8187a228 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 19 Dec 2011 19:06:25 -0800 Subject: bug 244 multiple birthday reminders from Diaspora if profile changed repeatedly --- boot.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 9f00d8d4b..61f14d9bc 100644 --- a/boot.php +++ b/boot.php @@ -1036,6 +1036,8 @@ function get_birthdays() { if($r && count($r)) { $total = 0; $now = strtotime('now'); + $cids = array(); + $istoday = false; foreach($r as $rr) { if(strlen($rr['name'])) @@ -1052,6 +1054,13 @@ function get_birthdays() { foreach($r as $rr) { if(! strlen($rr['name'])) continue; + + // avoid duplicates + + if(in_array($rr['cid'],$cids)) + continue; + $cids[] = $rr['cid']; + $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false); $sparkle = ''; $url = $rr['url']; -- cgit v1.2.3