[wp-trac] [WordPress Trac] #20060: wp_redirect() doesn't exit

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 22 21:50:29 UTC 2012


#20060: wp_redirect() doesn't exit
--------------------------------------+------------------------------
 Reporter:  iandunn                   |       Owner:
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Security                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  needs-patch dev-feedback  |
--------------------------------------+------------------------------
Changes (by kurtpayne):

 * cc: kpayne@… (added)


Comment:

 Replying to [comment:3 nacin]:
 > Thus, rather than a parameter, it would need to be:
 >
 > {{{
 > function wp_redirect_and_exit( $location, $status = 302 ) {
 >     wp_redirect( $location, $status );
 >     exit;
 > }
 > }}}


 We should avoid writing raw `exit` or `die` statements in the code without
 a way to override or hijack the behavior.  This kills unit tests.  I'd
 prefer to see this implemented similar to `wp_die` (or use `wp_die`
 outright).

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


More information about the wp-trac mailing list