Skip to:

Opened 14 years ago

Closed 12 years ago

#2032 closed defect (bug) (fixed)

Blank page after login

Reported by: pressography's profile Pressography Owned by:
Milestone: 1.6 Priority: minor
Severity: normal Version: 1.2
Component: Core Keywords: dev-feedback


When I log into my blog (MU w/ BP 1.2 activated, and no redirect_to value, I often get a blank page instead of into the wp-admin area.

When I deactivate BP, everything works as it's supposed to. I tracked the problem down to this section of code in the bp_core_login_redirect function:

if ( false === strpos( wp_get_referer(), 'wp-login.php' ) && false === strpos( wp_get_referer(), 'activate' ) && empty( $_REQUESTnr? ) )
return wp_get_referer();

The wp_get_referrer() function can return false, which it is doing in this case, and that's why the blank page shows up.

I suggest adding some logic here to check if wp_get_referrer() is false, and if it is, simply redirect to the root domain. This could probably be easily added to the if statement in the first line that I copied into this ticket.

Change History (10)

#1 @cnorris23
14 years ago

  • Keywords reporter-feedback added
  • Priority changed from major to minor

How are you logging in? Are you using a custom login form, or a plugin that handles/manipulates login? What version of PHP are you using? Are you running Apache, IIS, or otherwise server? There should only be a very small set of cases where this should happen.

#2 @Pressography
14 years ago

Logging in with the WP login form, no plugins manipulating the login. Not sure which version of PHP 5.2.9, Apache 2.2.11 - Typical HostGator shared server

Try it:

I've removed all plugins except for BP, just to make sure one wasn't messing with the login redirect, and still get the blank page.

I'll leave the site like that for the next day or so, thanks for working so hard on this awesome plugin!

#3 @cnorris23
14 years ago

I'm not able to check this out. I'm not sure if trac/a was meant to be some sort of username/pass combo, but I've tried it in multiple variations, and it's a no go. Do you have anything in your .htaccess file, other than the plain vanilla stuff added by WP when you turn on permalinks? What browser are you using, and have you tested to see if you replicate this behavior in another browser? If you're logging into your site from wp-login.php, then

if ( false === strpos( wp_get_referer(), 'wp-login.php' ) && false === strpos( wp_get_referer(), 'activate' ) && empty( $_REQUESTnr? ) )
return wp_get_referer();

should never even be triggered.

#4 @Pressography
14 years ago

Yeah, trac is the username, a is the pwd. You should have been able to log in with those credentials, they work just fine for me.

I haven't changed anything in the .htaccess aside from WP installs & adds for permalinks.

Interestingly, I don't seem to get the problem using IE 8, but I do every time with FF 3.5.8. But even after removing all FF add-ons, I still get the problem, and only when BP is activated.

#5 @cnorris23
14 years ago

Weird, when I tried the first time, I wasn't able to login, but it worked a few minutes ago. Testing with Firefox 3.6 and Safari 4.0.4, I wasn't able to replicate the issue. Try clearing your browser cache, and any cookies related to, and see if that clears things up.

#6 @Pressography
14 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Hmmm, still no go. Maybe it's a FF bug? I'll close this ticket, since you can't reproduce it, and if I figure out what's going on, and it's BP, I'll open another.


#7 @cnorris23
14 years ago

I've not seen any reports of 3.5.8 behaving like that, so I don't know that upgrading will fix it, but you never know. When you upgraded did you change the keys in wp-config.php (AUTH_KEY, SECRET_AUTH_KEY, etc)? If that causes problems, it normally causes the inability to login until you clear your cookies, but you never know.

#8 @r-a-y
13 years ago

  • Component set to Core
  • Keywords dev-feedback added; reporter-feedback removed
  • Resolution worksforme deleted
  • Severity set to normal
  • Status changed from closed to reopened
  • Version set to 1.2

I've recreated this bug on a custom config of Firefox 7.

If network.http.sendRefererHeader in Firefox is set to zero, wp_get_referer() is always false, which gives the WSOD blank page after login or any other page that requires wp_get_referer() when using bp_core_redirect(). Another example can be found when a user adds a friend.

This bug basically exists for all versions of Firefox not just 7.

Do you think it's wise to check if wp_get_referer() is empty? If so, redirect to a valid page?

It's a pretty edge case scenario for people who like to tweak Firefox or some other browser.

I'm going to reopen this ticket, but feel free to close if it's too minor.

I can provide a patch to address this if desired.

Last edited 13 years ago by r-a-y (previous) (diff)

#9 @boonebgorges
12 years ago

  • Milestone set to 1.6

I've run into the same problem that r-a-y describes above. In the short term, his suggestion that we check if it's empty is smart. (We can probably do a simple check inside of bp_core_redirect().) In the long run, maybe we could send a patch up to WP?

#10 @boonebgorges
12 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [5464]) In bp_core_redirect(), make sure we don't attempt to redirect to an empty string, to avoid problems with certain Firefox setups. Fixes #2032

Note: See TracTickets for help on using tickets.