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
|
b
|
|
6 | 6 | * @subpackage Administration |
7 | 7 | */ |
8 | 8 | |
| 9 | if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { |
| 10 | define( 'DOING_AJAX', true ); |
| 11 | } |
| 12 | |
9 | 13 | define('WP_ADMIN', true); |
10 | 14 | |
11 | 15 | if ( defined('ABSPATH') ) |
… |
… |
if ( !current_user_can('upload_files') ) |
32 | 36 | header('Content-Type: text/html; charset=' . get_option('blog_charset')); |
33 | 37 | |
34 | 38 | if ( isset( $_REQUEST['action'] ) && 'upload-attachment' === $_REQUEST['action'] ) { |
35 | | define( 'DOING_AJAX', true ); |
36 | 39 | include ABSPATH . 'wp-admin/includes/ajax-actions.php'; |
37 | 40 | |
38 | 41 | 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
|
b
|
function sanitize_email( $email ) { |
2291 | 2291 | * @return string Human readable time difference. |
2292 | 2292 | */ |
2293 | 2293 | function human_time_diff( $from, $to = '' ) { |
2294 | | if ( empty( $to ) ) |
| 2294 | if ( empty( $to ) ) { |
2295 | 2295 | $to = time(); |
| 2296 | } |
2296 | 2297 | |
2297 | 2298 | $diff = (int) abs( $to - $from ); |
2298 | 2299 | |
… |
… |
function human_time_diff( $from, $to = '' ) { |
2329 | 2330 | $since = sprintf( _n( '%s year', '%s years', $years ), $years ); |
2330 | 2331 | } |
2331 | 2332 | |
2332 | | return $since; |
| 2333 | /** |
| 2334 | * Filter the human readable difference between two timestamps. |
| 2335 | * |
| 2336 | * @since x.x.x |
| 2337 | * |
| 2338 | * @param string $since The difference in human readable text. |
| 2339 | * @param string $diff The difference in seconds. |
| 2340 | * @param string $from Unix timestamp from which the difference begins. |
| 2341 | * @param string $to Unix timestamp to end the time difference. |
| 2342 | */ |
| 2343 | return apply_filters( 'human_time_diff', $since, $diff, $from, $to ); |
2333 | 2344 | } |
2334 | 2345 | |
2335 | 2346 | /** |