From 5965616acaf13596a4764b294ca28e8dc9ee8fcb Mon Sep 17 00:00:00 2001
From: Andrew Nacin <wp@andrewnacin.com>
Date: Sat, 15 Mar 2014 19:59:15 +0000
Subject: [PATCH] Define DOING_AJAX earlier in async-upload.php.

props avryl.
fixes #27387. see [22902].

Built from https://develop.svn.wordpress.org/trunk@27558


git-svn-id: http://core.svn.wordpress.org/trunk@27401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-admin/async-upload.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/wp-admin/async-upload.php b/wp-admin/async-upload.php
index a16c8d3..b549511 100644
--- a/wp-admin/async-upload.php
+++ b/wp-admin/async-upload.php
@@ -6,6 +6,10 @@
  * @subpackage Administration
  */
 
+if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
+	define( 'DOING_AJAX', true );
+}
+
 define('WP_ADMIN', true);
 
 if ( defined('ABSPATH') )
@@ -32,7 +36,6 @@ if ( !current_user_can('upload_files') )
 header('Content-Type: text/html; charset=' . get_option('blog_charset'));
 
 if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) {
-	define( 'DOING_AJAX', true );
 	include ABSPATH . 'wp-admin/includes/ajax-actions.php';
 
 	send_nosniff_header();
-- 
1.7.11.1

From ca4c9c01b9c7eff76ee9b020213467174befc258 Mon Sep 17 00:00:00 2001
From: Jeroen Schmit <jeroen@slimndap.com>
Date: Sun, 16 Mar 2014 16:20:58 +0100
Subject: [PATCH] Added a filter to human_time_diff (including documentation).

---
 wp-includes/formatting.php | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 919336d..45b5b77 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -2291,8 +2291,9 @@ function sanitize_email( $email ) {
  * @return string Human readable time difference.
  */
 function human_time_diff( $from, $to = '' ) {
-	if ( empty( $to ) )
+	if ( empty( $to ) ) {
 		$to = time();
+	}
 
 	$diff = (int) abs( $to - $from );
 
@@ -2329,7 +2330,17 @@ function human_time_diff( $from, $to = '' ) {
 		$since = sprintf( _n( '%s year', '%s years', $years ), $years );
 	}
 
-	return $since;
+	/**
+	 * Filter the human readable difference between two timestamps.
+	 *
+	 * @since x.x.x
+	 *
+	 * @param string $since The difference in human readable text.
+	 * @param string $diff The difference in seconds.
+	 * @param string $from Unix timestamp from which the difference begins.
+	 * @param string $to Unix timestamp to end the time difference.
+	 */
+ 	return apply_filters( 'human_time_diff', $since, $diff, $from, $to );
 }
 
 /**
-- 
1.7.11.1

