Change Profile->getUser() to match the current user
Profile->getUser() gets the User independently from common_current_user. This means that changes to one does not affect the other, even if they are the same user. This commit changes that, so that getUser() returns common_current_user() if they are both the same user.
This is done to fix a bug in the user profile settings (actions/profilesettings.php), where changes in the language and timezone are applied to the return value of Profile->getUser() but not propagated to common_current_user(), which causes the profile settings to display incorrect information until the page is refreshed.
To observe the bug in action, just log in as any user, go to your profile settings, and change the language and/or timezone. Upon saving the changes, the changes will not seem to have been applied. Reloading the page shows that the settings actually were applied, but the object used to show the language and timezone (common_current_user) was stored in an independent variable and didn't get the memo.
I'm pretty new to all this, so a few questions:
- Would it have been better if I posted an issue before doing this?
- Also, I suppose I should have asked this on IRC before submitting this merge request, but is comparing users using === on their ids the right way to do it?