From 3ad52463f633b060bee519e8aa4d6e9453fdc2aa Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 20 Sep 2010 19:34:44 -0700 Subject: more robust feed error handling, at the expense of performance. Pass profile owner through HTML (yuk) to the ajax updater - as browser pre-fetch totally buggers passing it via the server session. --- mod/profile.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 31b634013..0d9c94eed 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -74,7 +74,11 @@ function profile_init(&$a) { } -function profile_content(&$a, $update = false) { +function profile_content(&$a, $update = 0) { + + + file_put_contents('uid.log',"{$_SERVER['QUERY_STRING']} ". session_id() . "\n", FILE_APPEND); + require_once("include/bbcode.php"); require_once('include/security.php'); @@ -86,13 +90,11 @@ function profile_content(&$a, $update = false) { if($update) { // Ensure we've got a profile owner if updating. - $a->profile['profile_uid'] = $_SESSION['profile_uid']; + $a->profile['profile_uid'] = $update; } else { - if($a->profile['uid'] == get_uid()) + if($a->profile['profile_uid'] == get_uid()) $o .= ''; - // set the uid so we can pick it up during update - $_SESSION['profile_uid'] = $a->profile['uid']; } $contact = null; @@ -158,8 +160,11 @@ function profile_content(&$a, $update = false) { )); } + // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, + // because browser prefetching might change it on us. We have to deliver it with the page. + if($tab == 'posts' && (! $a->pager['start'])) - $o .= '
' . "\r\n"; + $o .= '
' . "\r\n"; } // TODO alter registration and settings and profile to update contact table when names and photos change. -- cgit v1.2.3