WordPress.org

Make WordPress Core

Ticket #40035: 40035.2.diff

File 40035.2.diff, 1.4 KB (added by desrosj, 23 months ago)
  • src/wp-includes/ms-functions.php

     
    13681368        $path = trailingslashit($path);
    13691369        $site_id = (int) $site_id;
    13701370
    1371         $result = $wpdb->insert( $wpdb->blogs, array('site_id' => $site_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time('mysql')) );
     1371        $result = $wpdb->insert( $wpdb->blogs, array('site_id' => $site_id, 'domain' => $domain, 'path' => $path, 'registered' => current_time( 'mysql', true ) ) );
    13721372        if ( ! $result )
    13731373                return false;
    13741374
  • tests/phpunit/tests/multisite/site.php

     
    886886        }
    887887
    888888        /**
     889         * Test that last updated and registered dates are nearly identical.
     890         *
     891         * See 41064 & 40035
     892         *
     893         * @ticket 40035
     894         */
     895        function test_new_blog_last_updated_registered_nearly_identical() {
     896                $blog = self::factory()->blog->create_and_get();
     897
     898                $registered = date( 'U', strtotime( $blog->registered ) );
     899                $last_updated = date( 'U', strtotime( $blog->last_updated ) );
     900
     901                $this->assertLessThanOrEqual( 10, ( $last_updated - $registered ) );
     902        }
     903
     904        /**
    889905         * @ticket 33620
    890906         * @dataProvider data_new_blog_url_schemes
    891907         */