Ticket #37910: 37910.diff
File 37910.diff, 1.8 KB (added by , 4 years ago) |
---|
-
src/wp-includes/functions.php
89 89 $i = $unixtimestamp; 90 90 91 91 if ( false === $i ) { 92 if ( ! $gmt ) 93 $i = current_time( 'timestamp' ); 94 else 95 $i = time(); 96 // we should not let date() interfere with our 97 // specially computed timestamp 98 $gmt = true; 92 $i = current_time( 'timestamp', $gmt ); 99 93 } 100 94 101 95 /* … … 104 98 */ 105 99 $req_format = $dateformatstring; 106 100 107 $datefunc = $gmt? 'gmdate' : 'date';108 109 101 if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) { 110 $datemonth = $wp_locale->get_month( $datefunc( 'm', $i ) );102 $datemonth = $wp_locale->get_month( date( 'm', $i ) ); 111 103 $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth ); 112 $dateweekday = $wp_locale->get_weekday( $datefunc( 'w', $i ) );104 $dateweekday = $wp_locale->get_weekday( date( 'w', $i ) ); 113 105 $dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday ); 114 $datemeridiem = $wp_locale->get_meridiem( $datefunc( 'a', $i ) );115 $datemeridiem_capital = $wp_locale->get_meridiem( $datefunc( 'A', $i ) );106 $datemeridiem = $wp_locale->get_meridiem( date( 'a', $i ) ); 107 $datemeridiem_capital = $wp_locale->get_meridiem( date( 'A', $i ) ); 116 108 $dateformatstring = ' '.$dateformatstring; 117 109 $dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring ); 118 110 $dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring ); … … 140 132 } 141 133 } 142 134 } 143 $j = @ $datefunc( $dateformatstring, $i );135 $j = @date( $dateformatstring, $i ); 144 136 145 137 /** 146 138 * Filters the date formatted based on the locale.