From bae9eacaa1fae61509a1ea229486b5d4e8f0ef54 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 11 Apr 2011 11:17:14 -0400 Subject: [PATCH] use -1 for invalid arg default in ScopingNoticeStream --- lib/scopingnoticestream.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/scopingnoticestream.php b/lib/scopingnoticestream.php index a7ecbcd56b..30b80f10e5 100644 --- a/lib/scopingnoticestream.php +++ b/lib/scopingnoticestream.php @@ -49,16 +49,15 @@ class ScopingNoticeStream extends FilteringNoticeStream { protected $profile; - function __construct($upstream, $profile = null) + function __construct($upstream, $profile = -1) { parent::__construct($upstream); - if (empty($profile)) { - $user = common_current_user(); - if (!empty($user)) { - $profile = $user->getProfile(); - } + // Invalid but not null + if (is_int($profile) && $profile == -1) { + $profile = Profile::current(); } + $this->profile = $profile; } @@ -74,5 +73,4 @@ class ScopingNoticeStream extends FilteringNoticeStream { return $notice->inScope($this->profile); } - }