WordPress.org

Make WordPress Core

Ticket #8153: localized-dates-options-general-fixup.diff

File localized-dates-options-general-fixup.diff, 721 bytes (added by nbachiyski, 7 years ago)

Make second argument of date_i18n optional

  • wp-includes/functions.php

     
    112112 * @param int $unixtimestamp Unix timestamp 
    113113 * @return string The date, translated if locale specifies it. 
    114114 */ 
    115 function date_i18n( $dateformatstring, $unixtimestamp, $gmt = false ) { 
     115function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { 
    116116        global $wp_locale; 
    117117        $i = $unixtimestamp; 
    118118        // Sanity check for PHP 5.1.0- 
    119         if ( intval($i) < 1 ) 
     119        if ( false === $i || intval($i) < 0 ) 
    120120                $i = time(); 
    121121 
    122122        if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {