Make sure we have a valid timestamp. fixes #2148

git-svn-id: https://develop.svn.wordpress.org/trunk@3359 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2005-12-25 21:42:07 +00:00
parent 01d852fe7f
commit 76c78b624d
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];