From e24425d44ea6416f6d20add0e1e872fb23ff5214 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 22 Sep 2008 15:09:37 -0400 Subject: [PATCH] correct a couple of bugs darcs-hash:20080922190937-5ed1f-9439cd9cff178323ac1445f33e2520260b4b267e.gz --- classes/User.php | 10 ++++++++++ lib/util.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/User.php b/classes/User.php index 1168406ef8..fcae38c098 100644 --- a/classes/User.php +++ b/classes/User.php @@ -149,6 +149,16 @@ class User extends DB_DataObject } function noticesWithFriends($offset=0, $limit=20) { + + # We clearly need a more elegant way to make this work. + + if (common_config('memcached', 'enabled')) { + if ($offset + $limit <= WITHFRIENDS_CACHE_WINDOW) { + $cached = $this->noticesWithFriendsWindow(); + $wrapper = new NoticeWrapper(array_slice($cached, $offset, $limit)); + return $wrapper; + } + } $notice = new Notice(); diff --git a/lib/util.php b/lib/util.php index 48dd1a1b4a..edab7aad87 100644 --- a/lib/util.php +++ b/lib/util.php @@ -497,7 +497,7 @@ function common_language() { return $language; } } else { - return $config['site']['language']; + return common_config('site', 'language'); } } # salted, hashed passwords are stored in the DB -- 2.39.5