[wp-trac] [WordPress Trac] #23443: Change in behaviour of 'wp_signup_location' filter since WordPress 3.5

WordPress Trac noreply at wordpress.org
Tue Feb 19 02:57:34 UTC 2013


#23443: Change in behaviour of 'wp_signup_location' filter since WordPress 3.5
-------------------------------+-------------------------
 Reporter:  Cimmo              |       Owner:
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Multisite          |     Version:  3.5.1
 Severity:  normal             |  Resolution:  worksforme
 Keywords:  reporter-feedback  |
-------------------------------+-------------------------

Comment (by SergeyBiryukov):

 Replying to [comment:10 Cimmo]:
 > wp-signup.php line 25:
 > {{{
 > if ( !is_main_site() ) {
 >       wp_redirect( network_site_url( 'wp-signup.php' ) );
 >       die();
 > }
 > }}}
 >
 > In WP 3.4.x that IF with blog_id=2 in the URL for example returns always
 false.
 > In WP 3.5.x that IF with blog_id=2 in the URL for example returns true.
 Then it redirects to itself but without blog_id in the url.

 I see what you're talking about, but still cannot reproduce.

 Here are my exact steps:

 1. Created a new 3.5.1 Multisite install (subdirectory mode).
 2. Pasted this into `wp-content/mu-plugins/23443.php`:
 {{{
 <?php
 function change_signup_location_23443( $url ) {
         global $blog_id, $current_site;

         $attribute = '?blog_id=' . $blog_id;

         return 'http://' . $current_site->domain . $current_site->path .
 'wp-signup.php' . $attribute;
 }
 add_filter( 'wp_signup_location', 'change_signup_location_23443' );
 }}}
 3. Created a new site ("Site 1", `blog_id` is 2).
 4. Went to the new site, logged out, clicked the "Register" link in a
 sidebar widget.
 6. Ended up on `wp-signup.php?blog_id=2` with the registration form.

 > Anyway there is no really need to use my plug-in to reproduce just try
 to open this url in your browser using WP 3.5.x or greater:
 >
 > {{{
 >
 > http://localhost/wordpress-ms35/wp-signup.php?blog_id=7
 > }}}
 >
 > What happens to the blog_id parameter?

 Tried that too. For that URL, `is_main_site()` still returns true on a
 clean 3.5.1 install, so the condition in line 25 is not satisfied, and the
 additional redirect doesn't happen. The `blog_id` parameter is preserved.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23443#comment:12>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list