Date/Time: Make sure wp_date() does not unnecessarily escape localized numbers, but keeps localized slashes.

Props Rarst, tmatsuur, remcotolsma, peterwilsoncc.
Reviewed by peterwilsoncc.
Fixes #48319.
Built from https://develop.svn.wordpress.org/trunk@46569


git-svn-id: http://core.svn.wordpress.org/trunk@46366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-10-22 17:31:08 +00:00
parent ff65cfcacf
commit 4e06f0ad40
2 changed files with 7 additions and 7 deletions

View File

@ -254,22 +254,22 @@ function wp_date( $format, $timestamp = null, $timezone = null ) {
for ( $i = 0; $i < $format_length; $i ++ ) {
switch ( $format[ $i ] ) {
case 'D':
$new_format .= backslashit( $wp_locale->get_weekday_abbrev( $weekday ) );
$new_format .= addcslashes( $wp_locale->get_weekday_abbrev( $weekday ), '\\A..Za..z' );
break;
case 'F':
$new_format .= backslashit( $month );
$new_format .= addcslashes( $month, '\\A..Za..z' );
break;
case 'l':
$new_format .= backslashit( $weekday );
$new_format .= addcslashes( $weekday, '\\A..Za..z' );
break;
case 'M':
$new_format .= backslashit( $wp_locale->get_month_abbrev( $month ) );
$new_format .= addcslashes( $wp_locale->get_month_abbrev( $month ), '\\A..Za..z' );
break;
case 'a':
$new_format .= backslashit( $wp_locale->get_meridiem( $datetime->format( 'a' ) ) );
$new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'a' ) ), '\\A..Za..z' );
break;
case 'A':
$new_format .= backslashit( $wp_locale->get_meridiem( $datetime->format( 'A' ) ) );
$new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'A' ) ), '\\A..Za..z' );
break;
case '\\':
$new_format .= $format[ $i ];

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-RC1-46568';
$wp_version = '5.3-RC1-46569';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.