Changeset 9742 for trunk/wp-includes/functions.php
- Timestamp:
- 11/17/2008 09:31:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r9740 r9742 117 117 $i = $unixtimestamp; 118 118 // Sanity check for PHP 5.1.0- 119 if ( false === $i || intval($i) < 0 ) 120 $i = time(); 119 if ( false === $i || intval($i) < 0 ) { 120 if ( ! $gmt ) 121 $i = current_time( 'timestamp' ); 122 else 123 $i = time(); 124 // we should not let date() interfere with our 125 // specially computed timestamp 126 $gmt = true; 127 } 128 129 $datefunc = $gmt? 'gmdate' : 'date'; 121 130 122 131 if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) { 123 $datemonth = $wp_locale->get_month( date( 'm', $i ) );132 $datemonth = $wp_locale->get_month( $datefunc( 'm', $i ) ); 124 133 $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth ); 125 $dateweekday = $wp_locale->get_weekday( date( 'w', $i ) );134 $dateweekday = $wp_locale->get_weekday( $datefunc( 'w', $i ) ); 126 135 $dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday ); 127 $datemeridiem = $wp_locale->get_meridiem( date( 'a', $i ) );128 $datemeridiem_capital = $wp_locale->get_meridiem( date( 'A', $i ) );136 $datemeridiem = $wp_locale->get_meridiem( $datefunc( 'a', $i ) ); 137 $datemeridiem_capital = $wp_locale->get_meridiem( $datefunc( 'A', $i ) ); 129 138 $dateformatstring = ' '.$dateformatstring; 130 139 $dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring ); … … 137 146 $dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 ); 138 147 } 139 $j = $gmt? @gmdate( $dateformatstring, $i ) : @date( $dateformatstring, $i );148 $j = @$datefunc( $dateformatstring, $i ); 140 149 return $j; 141 150 }
Note: See TracChangeset
for help on using the changeset viewer.