From 3e95343a8808304184dab4d34c767ba24c2d3165 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Mon, 22 Sep 2008 10:26:44 +0000 Subject: [PATCH] MDL-16606 "userdate inserts a space in front of date when chopping off the leading 0 on day of the month produced by %d" extra space was used in front of %d so that we can detect the difference between a leading 0 and something like 10, 20, or 30. The extra space was removed along with any leading 0 but not if there was no leading zero. Now removing extra space even if there is no leading zero. --- lib/moodlelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 3a6132637e..452f71f1e5 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1254,7 +1254,7 @@ function userdate($date, $format='', $timezone=99, $fixday = true) { if (abs($timezone) > 13) { /// Server time if ($fixday) { $datestring = strftime($formatnoday, $date); - $daystring = str_replace(' 0', '', strftime(' %d', $date)); + $daystring = str_replace(array(' 0', ' '), '', strftime(' %d', $date)); $datestring = str_replace('DD', $daystring, $datestring); } else { $datestring = strftime($format, $date); -- 2.39.5