Cast substr()'s to int before passing through mktime() to prevent warning. Props josephscott. fixes #4166
git-svn-id: http://svn.automattic.com/wordpress/trunk@5284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8cbe134f81
commit
f2d8504d16
|
@ -8,7 +8,10 @@ function mysql2date($dateformatstring, $mysqlstring, $translate = true) {
|
|||
if ( empty($m) ) {
|
||||
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));
|
||||
$i = mktime(
|
||||
(int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
|
||||
(int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
|
||||
);
|
||||
|
||||
if( 'U' == $dateformatstring )
|
||||
return $i;
|
||||
|
|
Loading…
Reference in New Issue