Index: tests/phpunit/tests/functions/maybeDeclineDate.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/phpunit/tests/functions/maybeDeclineDate.php	(date 1573725321000)
+++ tests/phpunit/tests/functions/maybeDeclineDate.php	(date 1573813486438)
@@ -70,7 +70,8 @@
 			array( 'ru_RU', '21 Июнь', '21 июня' ),
 			array( 'ru_RU', '1 Январь 2016', '1 января 2016' ),
 			array( 'ru_RU', 'Январь 1st 2016', '1 января 2016' ),
-			array( 'ru_RU', 'Январь 1 2016', '1 января 2016' ),
+			array( 'ru_RU', 'Январь 1 2016', 'Январь 1 2016' ),
+			array( 'ru_RU', 'Пятница 1 Январь 2016', 'Пятница 1 Январь 2016' ),
 			array( 'pl_PL', '1 Styczeń', '1 stycznia' ),
 			array( 'hr', '1. Siječanj', '1. siječnja' ),
 			array( 'ca', '1 de abril', "1 d'abril" ),
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 1573725321000)
+++ src/wp-includes/functions.php	(date 1573813877816)
@@ -335,7 +335,7 @@
 		$months          = $wp_locale->month;
 		$months_genitive = $wp_locale->month_genitive;
 
-		// Match a format like 'j F Y' or 'j. F'
+		// Match a format like 'j F Y' or 'j. F' (day of the month, followed by month name) and decline the month.
 		if ( preg_match( '#^\d{1,2}\.? [^\d ]+#u', $date ) ) {
 
 			foreach ( $months as $key => $month ) {
@@ -349,10 +349,10 @@
 			$date = preg_replace( $months, $months_genitive, $date );
 		}
 
-		// Match a format like 'F jS' or 'F j' and change it to 'j F'
-		if ( preg_match( '#^[^\d ]+ \d{1,2}(st|nd|rd|th)? #u', trim( $date ) ) ) {
+		// Match a format like 'F jS' (month name, followed by day with ordinal suffix) and change it to declined 'j F'.
+		if ( preg_match( '#^[^\d ]+ \d{1,2}(st|nd|rd|th)#u', trim( $date ) ) ) {
 			foreach ( $months as $key => $month ) {
-				$months[ $key ] = '#' . $month . ' (\d{1,2})(st|nd|rd|th)?#u';
+				$months[ $key ] = '#' . $month . ' (\d{1,2})(st|nd|rd|th)#u';
 			}
 
 			foreach ( $months_genitive as $key => $month ) {
