Make sure we have a valid timestamp. fixes #2148

git-svn-id: http://svn.automattic.com/wordpress/trunk@3359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2005-12-25 21:42:07 +00:00
parent 9c99a92bc5
commit ca096fabad
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,10 @@ function mysql2date($dateformatstring, $mysqlstring, $translate = true) {
return false;
}
$i = mktime(substr($m,11,2),substr($m,14,2),substr($m,17,2),substr($m,5,2),substr($m,8,2),substr($m,0,4));
if ( -1 == $i || false == $i )
$i = 0;
if ( !empty($month) && !empty($weekday) && $translate ) {
$datemonth = $month[date('m', $i)];
$datemonth_abbrev = $month_abbrev[$datemonth];