Index: tests/phpunit/tests/date/wpDate.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/date/wpDate.php	(date 1571173968000)
+++ tests/phpunit/tests/date/wpDate.php	(date 1571312123420)
@@ -6,10 +6,57 @@
  */
 class Tests_Date_WP_Date extends WP_UnitTestCase {
 
+	/** @var WP_Locale */
+	private $wp_locale_original;
+
+	public function setUp() {
+		global $wp_locale;
+
+		parent::setUp();
+
+		$this->wp_locale_original = clone $wp_locale;
+	}
+
+	public function tearDown() {
+		global $wp_locale;
+
+		$wp_locale = $this->wp_locale_original;
+
+		parent::tearDown();
+	}
+
 	/**
 	 * @ticket 28636
 	 */
 	public function test_should_return_false_on_invalid_timestamp() {
 		$this->assertFalse( wp_date( DATE_RFC3339, 'invalid' ) );
 	}
+
+	/**
+	 * @ticket 48319
+	 */
+	public function test_should_not_escape_localized_numbers() {
+
+		global $wp_locale;
+
+		$wp_locale->month = array( 10 => '10月' );
+
+		$utc      = new DateTimeZone( 'UTC' );
+		$datetime = new DateTimeImmutable( '2019-10-17', $utc );
+
+		$this->assertEquals( '10月', wp_date( 'F', $datetime->getTimestamp(), $utc ) );
+	}
+
+	public function test_should_keep_localized_slashes() {
+
+		global $wp_locale;
+
+		$string           = 'A \ B';
+		$wp_locale->month = array( 10 => $string );
+
+		$utc      = new DateTimeZone( 'UTC' );
+		$datetime = new DateTimeImmutable( '2019-10-17', $utc );
+
+		$this->assertEquals( $string, wp_date( 'F', $datetime->getTimestamp(), $utc ) );
+	}
 }
Index: src/wp-includes/functions.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/wp-includes/functions.php	(date 1571173968000)
+++ src/wp-includes/functions.php	(date 1571311972804)
@@ -254,22 +254,22 @@
 		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 ];
