I18N: Adjust the regex in `wp_maybe_decline_date()` to avoid `\w` and `\b`, as they don't work with Unicode characters correctly in PHP 5.3.3 and earlier versions.
See [37975] for unit tests. See #36790. Built from https://develop.svn.wordpress.org/trunk@37979 git-svn-id: http://core.svn.wordpress.org/trunk@37920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bfe46464c5
commit
de1fab0b66
|
@ -182,14 +182,19 @@ function wp_maybe_decline_date( $date ) {
|
|||
*/
|
||||
if ( 'on' === _x( 'off', 'decline months names: on or off' ) ) {
|
||||
// Match a format like 'j F Y' or 'j. F'
|
||||
if ( @preg_match( '#^\d{1,2}\.? \w+#u', $date ) ) {
|
||||
if ( @preg_match( '#^\d{1,2}\.? [^\d ]+#u', $date ) ) {
|
||||
$months = $wp_locale->month;
|
||||
$months_genitive = $wp_locale->month_genitive;
|
||||
|
||||
foreach ( $months as $key => $month ) {
|
||||
$months[ $key ] = '#\b' . $month . '\b#u';
|
||||
$months[ $key ] = '# ' . $month . '( |$)#u';
|
||||
}
|
||||
|
||||
$date = preg_replace( $months, $wp_locale->month_genitive, $date );
|
||||
foreach ( $months_genitive as $key => $month ) {
|
||||
$months_genitive[ $key ] = ' ' . $month . '$1';
|
||||
}
|
||||
|
||||
$date = preg_replace( $months, $months_genitive, $date );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.6-beta1-37978';
|
||||
$wp_version = '4.6-beta1-37979';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue