Make createAnonProfile() static

This commit is contained in:
Zach Copley 2010-09-29 16:11:32 -07:00
parent f79f44801c
commit 54f19da3ab

View File

@ -203,7 +203,7 @@ class AnonymousFavePlugin extends Plugin {
$tally = Fave_tally::decrement($notice->id); $tally = Fave_tally::decrement($notice->id);
} }
function createAnonProfile() { static function createAnonProfile() {
// Get the anon user's IP, and turn it into a nickname // Get the anon user's IP, and turn it into a nickname
list($proxy, $ip) = common_client_ip(); list($proxy, $ip) = common_client_ip();
@ -253,7 +253,7 @@ class AnonymousFavePlugin extends Plugin {
// Do Profile lookup by ID instead of nickname for safety/performance // Do Profile lookup by ID instead of nickname for safety/performance
$profile = Profile::staticGet('id', $id); $profile = Profile::staticGet('id', $id);
} else { } else {
$profile = $this->createAnonProfile(); $profile = AnonymousFavePlugin::createAnonProfile();
// Obfuscate so it's hard to figure out the Profile ID // Obfuscate so it's hard to figure out the Profile ID
$_SESSION['anon_token'] = base64_encode($profile->nickname); $_SESSION['anon_token'] = base64_encode($profile->nickname);
} }