mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
![]() The usergetdate function is not only used to display dates, it is also passed to the function make_timestamp. This means users using another calendar type other than Gregorian will generate incorrect timestamps which may be saved in the DB or used to populate the date_selector and date_time_selector elements. For example, when creating an assignment using another calendar type other than Gregorian, the mod_form.php file calls $this->apply_admin_defaults() which uses the function usergetmidnight to set the "Allow submissions from" date to today's date and the "Due date" field to 7 days in the future. The usergetmidnight function calls usergetdate which is then passed to make_timestamp. Since the usergetdate function was using the calendar type's timestamp_to_date_array function the date being passed to make_timestamp was not in Gregorian. So, when using the hijri calendar the year 1434 was being passed which was generating a large negative number as the timestamp which was then used to populate the date fields. |
||
---|---|---|
.. | ||
classes | ||
tests | ||
type/gregorian | ||
yui | ||
delete.php | ||
event.php | ||
event_form.php | ||
export.php | ||
export_execute.php | ||
externallib.php | ||
index.php | ||
lib.php | ||
managesubscriptions.php | ||
managesubscriptions_form.php | ||
preferences.php | ||
preferences_form.php | ||
renderer.php | ||
set.php | ||
upgrade.txt | ||
view.php |