Make WordPress Core

Changeset 43163 for branches/4.9


Ignore:
Timestamp:
05/03/2018 09:14:43 PM (6 years ago)
Author:
azaozz
Message:

Privacy: Return before scheduling cron during install to avoid error.

r43046 introduced wp_schedule_delete_old_privacy_export_files() to schedule the wp_privacy_delete_old_export_files cron job, but it did not check to make sure it wasn't running in the context of the install process. When it did run in that context, it created a database error, because the necessary database tables don't exist at that point.

Checking the current context and returning early during the installation phase avoids that issue.

Props helen, timothyblynjacobs, iandunn.
Merges [43162] to the 4.9 branch.
Fixes #43952.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/functions.php

    r43136 r43163  
    59535953 */
    59545954function wp_schedule_delete_old_privacy_export_files() {
     5955    if ( wp_installing() ) {
     5956        return;
     5957    }
     5958
    59555959    if ( ! wp_next_scheduled( 'wp_privacy_delete_old_export_files' ) ) {
    59565960        wp_schedule_event( time(), 'hourly', 'wp_privacy_delete_old_export_files' );
Note: See TracChangeset for help on using the changeset viewer.