From 436bf0016fa5a9d551d05988b5f51a8a204ff5b0 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Fri, 31 Aug 2012 19:14:43 +0000 Subject: [PATCH] Media: Use numeric timestamps instead of string-based timestamps when preparing an attachment for js. We use the 'date' attribute to create Javascript Date objects. The Date() constructor has better cross-browser compatibility when numeric arguments are passed to the constructor. see #21390. git-svn-id: https://develop.svn.wordpress.org/trunk@21691 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index c7443068dd..342edd46d9 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1565,8 +1565,8 @@ function wp_prepare_attachment_for_js( $attachment ) { 'name' => $attachment->post_name, 'status' => $attachment->post_status, 'uploadedTo' => $attachment->post_parent, - 'date' => $attachment->post_date_gmt . ' UTC', - 'modified' => $attachment->post_modified_gmt . ' UTC', + 'date' => strtotime( $attachment->post_date_gmt ) * 1000, + 'modified' => strtotime( $attachment->post_modified_gmt ) * 1000, 'mime' => $attachment->post_mime_type, 'type' => $type, 'subtype' => $subtype,