WordPress.org

Make WordPress Core

Ticket #2568: functions.php.diff

File functions.php.diff, 2.9 KB (added by Sewar, 9 years ago)
  • E:/PHP/WordPress/SVN/wp-includes/functions.php

     
    1616} 
    1717 
    1818function mysql2date($dateformatstring, $mysqlstring, $translate = true) { 
    19         global $month, $weekday, $month_abbrev, $weekday_abbrev; 
     19        global $month, $weekday, $month_abbrev, $weekday_abbrev, $meridiem; 
    2020        $m = $mysqlstring; 
    2121        if ( empty($m) ) { 
    2222                return false; 
     
    3131                $datemonth_abbrev = $month_abbrev[$datemonth]; 
    3232                $dateweekday = $weekday[date('w', $i)]; 
    3333                $dateweekday_abbrev = $weekday_abbrev[$dateweekday]; 
     34                $datemeridiem = $meridiem[date('a', $i)]; 
     35                $datemeridiem_capital = $meridiem[date('A', $i)]; 
    3436                $dateformatstring = ' '.$dateformatstring; 
    3537                $dateformatstring = preg_replace("/([^\\\])D/", "\\1".backslashit($dateweekday_abbrev), $dateformatstring); 
    3638                $dateformatstring = preg_replace("/([^\\\])F/", "\\1".backslashit($datemonth), $dateformatstring); 
    3739                $dateformatstring = preg_replace("/([^\\\])l/", "\\1".backslashit($dateweekday), $dateformatstring); 
    3840                $dateformatstring = preg_replace("/([^\\\])M/", "\\1".backslashit($datemonth_abbrev), $dateformatstring); 
     41                $dateformatstring = preg_replace("/([^\\\])a/", "\\1".backslashit($datemeridiem), $dateformatstring); 
     42                $dateformatstring = preg_replace("/([^\\\])A/", "\\1".backslashit($datemeridiem_capital), $dateformatstring); 
    3943 
    4044                $dateformatstring = substr($dateformatstring, 1, strlen($dateformatstring)-1); 
    4145        } 
     
    6367} 
    6468 
    6569function date_i18n($dateformatstring, $unixtimestamp) { 
    66         global $month, $weekday, $month_abbrev, $weekday_abbrev; 
     70        global $month, $weekday, $month_abbrev, $weekday_abbrev, $meridiem; 
    6771        $i = $unixtimestamp; 
    6872        if ( (!empty($month)) && (!empty($weekday)) ) { 
    6973                $datemonth = $month[date('m', $i)]; 
    7074                $datemonth_abbrev = $month_abbrev[$datemonth]; 
    7175                $dateweekday = $weekday[date('w', $i)]; 
    7276                $dateweekday_abbrev = $weekday_abbrev[$dateweekday]; 
     77                $datemeridiem = $meridiem[date('a', $i)]; 
     78                $datemeridiem_capital = $meridiem[date('A', $i)]; 
    7379                $dateformatstring = ' '.$dateformatstring; 
    7480                $dateformatstring = preg_replace("/([^\\\])D/", "\${1}".backslashit($dateweekday_abbrev), $dateformatstring); 
    7581                $dateformatstring = preg_replace("/([^\\\])F/", "\${1}".backslashit($datemonth), $dateformatstring); 
    7682                $dateformatstring = preg_replace("/([^\\\])l/", "\${1}".backslashit($dateweekday), $dateformatstring); 
    7783                $dateformatstring = preg_replace("/([^\\\])M/", "\${1}".backslashit($datemonth_abbrev), $dateformatstring); 
     84                $dateformatstring = preg_replace("/([^\\\])a/", "\${1}".backslashit($datemeridiem), $dateformatstring); 
     85                $dateformatstring = preg_replace("/([^\\\])A/", "\${1}".backslashit($datemeridiem_capital), $dateformatstring); 
     86 
    7887                $dateformatstring = substr($dateformatstring, 1, strlen($dateformatstring)-1); 
    7988        } 
    8089        $j = @date($dateformatstring, $i);