From 3adda9c1acaf673608fa00ac79f47446560d2bb7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 15 Mar 2007 08:40:11 +0000 Subject: [PATCH] ok, another fix to the birthday conversion. Thanks rxu for debugging this. :) git-svn-id: file:///svn/phpbb/trunk@7199 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/functions_phpbb20.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 0f364eefde..93677201be 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -410,9 +410,12 @@ function phpbb_get_birthday($birthday = '') return ' 0- 0- 0'; } - $month = substr($birthday, 0, 2); - $day = substr($birthday, 2, 2); - $year = substr($birthday, -4); + // We use the original mod code to retrieve the birthday (not ideal) + preg_match('/(..)(..)(....)/', sprintf('%08d', $birthday), $birthday_parts); + + $month = $birthday_parts[1]; + $day = $birthday_parts[2]; + $year = $birthday_parts[3]; return sprintf('%2d-%2d-%4d', $day, $month, $year); }