From 70d9869e3881613f60768597f15f37ad57887445 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Wed, 23 Dec 2015 01:39:28 +0000 Subject: [PATCH] I18N: In `wp_maybe_decline_date()`, bail early if translation functions are not available, e.g. in `SHORTINIT` mode. Merges [35880] to the 4.4 branch. Props SergeyBiryukov. Fixes #34967. Built from https://develop.svn.wordpress.org/branches/4.4@36063 git-svn-id: http://core.svn.wordpress.org/branches/4.4@36028 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index e3fb35317c..b3781639e2 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -172,6 +172,11 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { function wp_maybe_decline_date( $date ) { global $wp_locale; + // i18n functions are not available in SHORTINIT mode + if ( ! function_exists( '_x' ) ) { + return $date; + } + /* translators: If months in your language require a genitive case, * translate this to 'on'. Do not translate into your own language. */ diff --git a/wp-includes/version.php b/wp-includes/version.php index ea3e51cffc..553858668b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4.1-alpha-36060'; +$wp_version = '4.4.1-alpha-36063'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.