Changeset 43434
- Timestamp:
- 07/05/2018 11:10:01 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r43406 r43434 107 107 */ 108 108 $req_format = $dateformatstring; 109 110 $dateformatstring = preg_replace( "/(?<!\\\\)c/", DATE_W3C, $dateformatstring ); 111 $dateformatstring = preg_replace( "/(?<!\\\\)r/", DATE_RFC2822, $dateformatstring ); 109 112 110 113 if ( ( ! empty( $wp_locale->month ) ) && ( ! empty( $wp_locale->weekday ) ) ) { -
trunk/tests/phpunit/tests/date/dateI18n.php
r43389 r43434 84 84 $this->assertEquals( $datetime->format( $timezone_formats ), date_i18n( $timezone_formats ) ); 85 85 } 86 87 /** 88 * @dataProvider data_formats 89 * @ticket 20973 90 */ 91 public function test_date_i18n_handles_shorthand_formats( $short, $full ) { 92 $this->assertEquals( date_i18n( $full ), date_i18n( $short ) ); 93 $this->assertEquals( $short, date_i18n( '\\' . $short ) ); 94 } 95 96 public function data_formats() { 97 return array( 98 array( 99 'c', 100 'Y-m-d\TH:i:sP', 101 ), 102 array( 103 'r', 104 'D, d M Y H:i:s O', 105 ), 106 ); 107 } 86 108 }
Note: See TracChangeset
for help on using the changeset viewer.