From 642b38246bcfc7fb41076315cc76c9d79f8ead33 Mon Sep 17 00:00:00 2001 From: rob1n Date: Thu, 19 Apr 2007 02:49:19 +0000 Subject: [PATCH] Cast substr()'s to int before passing through mktime() to prevent warning. Props josephscott. fixes #4166 git-svn-id: https://develop.svn.wordpress.org/trunk@5284 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index f14790828d..358593b1bd 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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;