From: Evan Prodromou <evan@prodromou.name>
Date: Sat, 17 May 2008 19:35:20 +0000 (-0400)
Subject: ensure rather than check for session
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=30d4b7f7919d51cd462c95310a4b32bfc0cad256;p=quix0rs-gnu-social.git

ensure rather than check for session

darcs-hash:20080517193520-84dde-e0e0ad44fa0b87e7964fa36375b656e7cfabf865.gz
---

diff --git a/lib/common.php b/lib/common.php
index b6e01a0962..425fbccb4f 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -227,11 +227,10 @@ function common_set_user($nickname) {
 function common_current_user() {
 	static $user = NULL; # FIXME: global memcached
 	if (is_null($user)) {
-		if (common_have_session()) {
-			$id = $_SESSION['userid'];
-			if ($id) {
-				$user = User::staticGet($id);
-			}
+		common_ensure_session();
+		$id = $_SESSION['userid'];
+		if ($id) {
+			$user = User::staticGet($id);
 		}
 	}
 	return $user;