Making WordPress.org


Ignore:
Timestamp:
04/15/2017 10:47:44 AM (7 years ago)
Author:
Otto42
Message:

Plugin Directory: Import script should set post modified time if existing time is not set. This prevents a 2019 years ago condition which is caused by plugins being approved and having a version number set for them, but then having that same version be checked into SVN, thus not having a version difference to cause the initial update time to change. Fixes #2740

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/cli/class-import.php

    r5317 r5338  
    8282        $plugin->post_excerpt = trim( $readme->short_description ) ?: $headers->Description ?: $plugin->post_excerpt;
    8383
    84         // Bump last updated if the version has changed, but only if this isn't a fresh import.
    85         if ( !isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) {
     84        // Bump last updated if the version has changed, or if the post_modified is empty (which is the case for many initial checkins).
     85        if ( ( !isset( $headers->Version ) || $headers->Version != get_post_meta( $plugin->ID, 'version', true ) ) ||
     86             ( $plugin->post_modified == '0000-00-00 00:00:00' ) ) {
    8687            $plugin->post_modified = $plugin->post_modified_gmt = current_time( 'mysql' );
    8788        }
Note: See TracChangeset for help on using the changeset viewer.