[wp-trac] [WordPress Trac] #54952: 5.9 breaks auth_redirect?

WordPress Trac noreply at wordpress.org
Thu Jan 27 13:35:39 UTC 2022


#54952: 5.9 breaks auth_redirect?
--------------------------+-----------------------------
 Reporter:  EPinci        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 I added the following snippet to TwentyTwelve's functions.php file:

 {{{#!php
   add_shortcode('need_login', 'shortcode_needLogin');

   function shortcode_needLogin() {
    if(!is_user_logged_in()) {
     auth_redirect();
    }
 }}}

 So that adding a [need_login] shortcode to a page triggers a login.

 --> Works with PHP8.0.15(win) and WP5.8.3.
 --> Broken in WP5.9 and PHP8.0.15(win) resulting in a blank content and
 the following PHP error:

 `[27-Jan-2022 13:19:48 UTC] PHP Warning:  Cannot modify header information
 - headers already sent by (output started at D:\Inetpub\WWWRoot\wordpress
 \wp-includes\class.wp-styles.php:214) in D:\Inetpub\WWWRoot\wordpress\wp-
 includes\pluggable.php on line 1358`

 Seems all core related, is it a regression?

 Thank you.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54952>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list