Fix date() warning on Windows. Props ozh. fixes #7186

git-svn-id: http://svn.automattic.com/wordpress/trunk@8199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-06-26 18:34:28 +00:00
parent 5360b75e83
commit 3489826131
1 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,10 @@ function current_time( $type, $gmt = 0 ) {
function date_i18n( $dateformatstring, $unixtimestamp ) { function date_i18n( $dateformatstring, $unixtimestamp ) {
global $wp_locale; global $wp_locale;
$i = $unixtimestamp; $i = $unixtimestamp;
// Sanity check for PHP 5.1.0-
if ( -1 == $i )
$i = false;
if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) { if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
$datemonth = $wp_locale->get_month( date( 'm', $i ) ); $datemonth = $wp_locale->get_month( date( 'm', $i ) );
$datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth ); $datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );