[wp-trac] [WordPress Trac] #43159: Introduce helper function for XMLRPC checks
WordPress Trac
noreply at wordpress.org
Fri Jan 26 17:04:19 UTC 2018
#43159: Introduce helper function for XMLRPC checks
----------------------------+------------------------------
Reporter: NathanAtmoz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+------------------------------
Comment (by NathanAtmoz):
@birgire: Thanks for looking at the patch.
Replying to [comment:1 birgire]:
> - I don't think we should add {{{wp_doing_xmlrpc()}}} in that line in
{{{wp-cron.php}}}, because that file can be requested directly, (see e.g.
within {{{spawn_cron()}}}
[https://core.trac.wordpress.org/browser/tags/4.9/src/wp-
includes/cron.php#L353 here] ) and then {{{wp_doing_xmlrpc()}}} wouldn't
be defined and resulting in a PHP error. Some users rely on Unix Cron
instead, requesting that file from there.
I don't see {{{wp_doing_xmlrpc()}}} in {{{wp-cron.php}}} in the patch? Am
I missing something?
> - I found an extra {{{defined( 'XMLRPC_REQUEST' )}}} check in
{{{spawn_cron()}}} ([https://core.trac.wordpress.org/browser/tags/4.9/src
/wp-includes/cron.php#L275 src]), but I noticed that {{{defined(
'DOING_AJAX' )}}} and {{{defined( 'DOING_CRON' )}}} have not been
replaced. Most likely a reason for that, but we could look further into
that.
I originally didn't use {{{wp_doing_xmlrpc()}}} here because the other
constants hadn't been replaced. But this function is loaded really early,
and the only place it's called in core is hooked to {{{init}}}.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43159#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list