[wp-trac] [WordPress Trac] #44429: WP-CLI incompatibility with wp_redirect( https://... )

WordPress Trac noreply at wordpress.org
Fri Jun 22 15:42:55 UTC 2018


#44429: WP-CLI incompatibility with wp_redirect( https://... )
------------------------------------------------+--------------------------
 Reporter:  ecahost7                            |       Owner:  (none)
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
                                                |  Review
Component:  General                             |     Version:
 Severity:  major                               |  Resolution:
 Keywords:  dev-feedback has-patch 2nd-opinion  |     Focuses:
------------------------------------------------+--------------------------

Comment (by afragen):

 Replying to [comment:7 schlessera]:
 > @afragen I'd say it is actually an issue in the plugin that causes the
 redirect. Basically, the plugin does a "web-request-only" operation when
 it is not actually dealing with a web request.
 >
 > That being said, there's a general assumption with WordPress that the
 code is only ever run in a web server context, so it is an easy trap for
 plugin developers to fall into... which means it might make sense to fix
 it from within Core.
 >
 > However, if this is to be fixed in Core, I would suggest fixing it in a
 more general way by checking for the `cli` SAPI, not for WP-CLI
 specifically.

 I can create another patch that does this check instead.

 >
 > I have to admit that I ignore what the possible combinations of use
 cases vs environments are, though, so I'm a bit worried we will just break
 something else in the process.

 And that’s precisely my problem too. I can’t really see all the far
 reaching effects this might have. On the surface it would seem to be
 straightforward as it would simply skip the function if the user is using
 a CLI.

 Is there ever a use case for a redirect when using the CLI?

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


More information about the wp-trac mailing list