Skip to:

Opened 11 years ago

Last modified 10 years ago

#4809 new defect (bug)

broken logic in bp_core_wpsignup_redirect causes redirect loop to register page

Reported by: tometzky's profile tometzky Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: major Version: 1.6.2
Component: Members Keywords: needs-testing


A broken logic in bp_core_wpsignup_redirect() function causes buddypress 1.6.4 to loop endlessly on every page other than /.

I think it is supposed to trigger a redirect to bp_get_signup_page() when:

$_SERVER['SCRIPT_NAME'] contains wp-signup.php
or/and (I don't know which)
$_GET['action'] is equal to register

register.php or registration/register.php template exists.

But instead it triggers a redirect when $_SERVER['SCRIPT_NAME'] is empty!

I'm attaching a proposed patch, but I'm assuming that a redirect should be performed only when $_SERVER['SCRIPT_NAME'] contains wp-signup.php and also $_GET['action'] is equal to register.

There are several people on support forums which have problems with endless loop to register page.

Attachments (1)

buddypress-1.6.4-loop-to-register.patch (1.3 KB) - added by tometzky 11 years ago.
Proposed patch.

Download all attachments as: .zip

Change History (11)

11 years ago

Proposed patch.

#1 follow-up: @boonebgorges
11 years ago

  • Keywords has-patch needs-testing reporter-feedback added

I don't see any specific harm in this patch, though I'm a bit perplexed why $_SERVER['SCRIPT_NAME'] would be empty. A bit of googling:

Just want to understand the issue a little better before committing this fix.

#2 @tometzky
11 years ago

I've replaced proposed patch, as after some tests I'm now convinced that the logic should be:

Redirect is performed if:
        $_SERVER['SCRIPT_NAME'] contains 'wp-signup.php'
        $_GET['action'] is equal to 'register'
    ( 'register.php' or 'registration/register.php' template exists )

#3 in reply to: ↑ 1 @tometzky
11 years ago

Replying to boonebgorges:

I don't see any specific harm in this patch, though I'm a bit perplexed why $_SERVER['SCRIPT_NAME'] would be empty.

I think it's a fairly common configuration:

  • CentOS 5 64bit server;
  • Distibution provided httpd with also distribution provided mod_php 5.3 but behind a reverse proxy;
  • Pretty Permalinks rewrites in httpd.conf, not in .htaccess:
RewriteCond /var/www/site/wordpress%{REQUEST_FILENAME} !-f
RewriteCond /var/www/site/wordpress%{REQUEST_FILENAME} !-d
RewriteRule ^/(([a-z0-9_-]*/)*) /index.php/$1 [nocase,last,nosubreq]
Last edited 11 years ago by tometzky (previous) (diff)

#4 @boonebgorges
11 years ago

  • Milestone changed from Awaiting Review to 1.7

Cool, thanks for the additional info. Based on the links I gave above, I'm guessing it's the last bit that's at the root of this (putting mod_rewrite directives in your vhost config rather than .htaccess). I'll try to reproduce.

#5 @tometzky
11 years ago

  • Keywords reporter-feedback removed

I've removed reporter-feedback keyword, as no feedback is now required.

#6 @DJPaul
11 years ago

  • Milestone changed from 1.7 to Future Release

#7 @DJPaul
10 years ago

  • Keywords has-patch removed
  • Milestone changed from Future Release to 1.8

#8 @boonebgorges
10 years ago

  • Milestone changed from 1.8 to Future Release

#9 @tometzky
10 years ago

Why this simple fix is deferred again?

#10 @boonebgorges
10 years ago

So far, I've been unable to reproduce the original problem. Until I can, I'm very wary of putting in the suggested fix.

Note: See TracTickets for help on using tickets.