Make WordPress Core

Changeset 43162 for trunk


Ignore:
Timestamp:
05/03/2018 09:11:00 PM (6 years ago)
Author:
iandunn
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.
Fixes #43952.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r43081 r43162  
    62656265 */
    62666266function wp_schedule_delete_old_privacy_export_files() {
     6267    if ( wp_installing() ) {
     6268        return;
     6269    }
     6270
    62676271    if ( ! wp_next_scheduled( 'wp_privacy_delete_old_export_files' ) ) {
    62686272        wp_schedule_event( time(), 'hourly', 'wp_privacy_delete_old_export_files' );
Note: See TracChangeset for help on using the changeset viewer.