From d6db8e58170e6e78a0fd67d50f7fea5d95b5d9c8 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 6 Jan 2010 13:40:28 -0800 Subject: Don't output notices from deleted users. --- lib/jsonsearchresultslist.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/jsonsearchresultslist.php b/lib/jsonsearchresultslist.php index 569bfa873..0d72ddf7a 100644 --- a/lib/jsonsearchresultslist.php +++ b/lib/jsonsearchresultslist.php @@ -105,8 +105,14 @@ class JSONSearchResultsList break; } - $item = new ResultItem($this->notice); - array_push($this->results, $item); + $profile = $this->notice->getProfile(); + + // Don't show notices from deleted users + + if (!empty($profile)) { + $item = new ResultItem($this->notice); + array_push($this->results, $item); + } } $time_end = microtime(true); -- cgit v1.2.3-54-g00ecf From 30409f7bad45862ce498d7084ab2a8a4287e7d3f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 10 Jan 2010 12:07:49 -0800 Subject: debugging code to find passed-in objects in munge_password --- lib/util.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/util.php b/lib/util.php index fdcc87677..00d1ab557 100644 --- a/lib/util.php +++ b/lib/util.php @@ -62,7 +62,7 @@ function common_init_language() // gettext will still select the right language. $language = common_language(); $locale_set = common_init_locale($language); - + setlocale(LC_CTYPE, 'C'); // So we do not have to make people install the gettext locales $path = common_config('site','locale_path'); @@ -119,6 +119,11 @@ function common_language() function common_munge_password($password, $id) { + if (is_object($id) || is_object($password)) { + $e = new Exception(); + common_log(LOG_ERR, __METHOD__ . ' object in param to common_munge_password ' . + str_replace("\n", " ", $e->getTraceAsString())); + } return md5($password . $id); } -- cgit v1.2.3-54-g00ecf From 6fdd52467dea6164d71afc9b80e1f8bcf5fb1b9a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 10 Jan 2010 13:54:26 -0800 Subject: catch exceptions from snapshot --- lib/snapshot.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/snapshot.php b/lib/snapshot.php index 2a10c6b93..a16087ac0 100644 --- a/lib/snapshot.php +++ b/lib/snapshot.php @@ -173,8 +173,12 @@ class Snapshot // XXX: Use OICU2 and OAuth to make authorized requests $reporturl = common_config('snapshot', 'reporturl'); - $request = HTTPClient::start(); - $request->post($reporturl, null, $this->stats); + try { + $request = HTTPClient::start(); + $request->post($reporturl, null, $this->stats); + } catch (Exception $e) { + common_log(LOG_WARNING, "Error in snapshot: " . $e->getMessage()); + } } /** -- cgit v1.2.3-54-g00ecf From 7aa43f3c93a5434b59a66824b2816d5ba8cf1978 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 10 Jan 2010 14:10:31 -0800 Subject: defaultDesign was undefined; fixed that --- lib/api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/api.php b/lib/api.php index 4ed49e452..06d7c079d 100644 --- a/lib/api.php +++ b/lib/api.php @@ -140,12 +140,14 @@ class ApiAction extends Action // Note: some profiles don't have an associated user + $defaultDesign = Design::siteDesign(); + if (!empty($user)) { $design = $user->getDesign(); } if (empty($design)) { - $design = Design::siteDesign(); + $design = $defaultDesign; } $color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor); -- cgit v1.2.3-54-g00ecf