[wp-trac] [WordPress Trac] #60926: Missing calling `exit` after using `wp_redirect`

WordPress Trac noreply at wordpress.org
Fri Jun 21 05:27:28 UTC 2024


#60926: Missing calling `exit` after using `wp_redirect`
--------------------------------+----------------------------------------
 Reporter:  jigar bhanushali    |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  6.6
Component:  Networks and Sites  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  has-patch           |     Focuses:  administration, multisite
--------------------------------+----------------------------------------

Comment (by rajinsharwar):

 Just to put some context, we use wp_redirect() in multiple places in the
 core where we want to continue the page processing after doing the
 redirect. So, exiting within the function will break the core a lot, as
 well as plugins or themes using it, in case they are also processing after
 redirect.

 Examples from core:
 https://github.com/WordPress/wordpress-
 develop/blob/33f443597f25bcfdc25cfbd73e57e601227ea809/src/wp-
 admin/update.php#L85
 https://github.com/WordPress/wordpress-
 develop/blob/33f443597f25bcfdc25cfbd73e57e601227ea809/src/wp-admin/nav-
 menus.php#L608
 https://github.com/WordPress/wordpress-
 develop/blob/33f443597f25bcfdc25cfbd73e57e601227ea809/src/wp-admin/user-
 edit.php#L122
 https://github.com/WordPress/wordpress-
 develop/blob/33f443597f25bcfdc25cfbd73e57e601227ea809/src/wp-
 admin/includes/plugin.php#L667
 ...

 My opinion is to close this as won't-fix.

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


More information about the wp-trac mailing list