[wp-trac] [WordPress Trac] #31224: maybe_add_existing_user_to_blog() returns http response 500 even on success

WordPress Trac noreply at wordpress.org
Tue Feb 3 21:55:39 UTC 2015


#31224: maybe_add_existing_user_to_blog() returns http response 500 even on success
--------------------------+------------------
 Reporter:  drzaphod      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.2
Component:  Users         |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------
Changes (by TobiasBg):

 * keywords:   => needs-patch
 * milestone:  Awaiting Review => 4.2


Old description:

> File: wp-includes/ms-functions.php
> Function: maybe_add_existing_user_to_blog()
> Line: 1938
>
> Calling this function will return HTTP 500 (Server Error) even when the
> function succeeds. This can cause problems when a caching server such as
> Varnish reacts unfavorably to the 500 and redirects the user to a sorry
> page.
>
> Replace line 1938 with the following to correct.
>
> wp_die( sprintf( __( 'You have been added to this site. Please visit the
> <a href="%s">homepage</a> or <a href="%s">log in</a> using your username
> and password.' ), home_url(), admin_url() ), __( 'WordPress ›
> Success' ), array('response'=>200) );

New description:

 File: wp-includes/ms-functions.php
 Function: `maybe_add_existing_user_to_blog()`
 Line: 1938

 Calling this function will return HTTP 500 (Server Error) even when the
 function succeeds. This can cause problems when a caching server such as
 Varnish reacts unfavorably to the 500 and redirects the user to a sorry
 page.

 Replace line 1938 with the following to correct.
 {{{
 wp_die( sprintf( __( 'You have been added to this site. Please visit the
 <a href="%s">homepage</a> or <a href="%s">log in</a> using your username
 and password.' ), home_url(), admin_url() ), __( 'WordPress ›
 Success' ), array( 'response' => 200 ) );
 }}}

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31224#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list