You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 01fd6ee
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(I18n): compute correct date in Time::today(), yesterday(), and tomorrow() across timezones (#10532)
* fix(I18n): fix timezone and testNow calculation in Time::today(), yesterday(), and tomorrow()
- Compute start of day relative to the requested timezone instead of the server default timezone
- Respect Time::setTestNow() mock instance in today(), yesterday(), and tomorrow()
- Add unit tests covering date boundary transitions across different timezones
- Add changelog entry in v4.7.5.rst
* Update user_guide_src/source/changelogs/v4.7.5.rst
Co-authored-by: neznaika0 <ozornick.ks@gmail.com>
* Fix multiple bugs in Files, Helpers, Honeypot, I18n, Logger, and Cache
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix(I18n): address review suggestions for Time::today/yesterday/tomorrow
Use new static(null) instead of static::now() to avoid coupling overridable extension points, and freeze time in testTodayLocalized to prevent intermittent failure across timezones.
* Update system/I18n/TimeTrait.php
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
* Update tests/system/I18n/TimeTest.php
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
* Update system/I18n/TimeTrait.php
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
* Update tests/system/I18n/TimeTest.php
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
* style: correct indentation in TimeTest
---------
Co-authored-by: neznaika0 <ozornick.ks@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Michal Sniatala <michal@sniatala.pl>
Copy file name to clipboardExpand all lines: user_guide_src/source/changelogs/v4.7.5.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Bugs Fixed
50
50
- **Files:** Fixed a bug where ``File::move()`` and ``UploadedFile::move()`` set executable and overly permissive file permissions (``0777 & ~umask()`` instead of ``0666 & ~umask()``), and ``UploadedFile::move()`` targeted the parent directory instead of the destination file for ``chmod()``.
51
51
- **Helpers:** Fixed a bug where ``get_dir_file_info()`` returned incomplete entries for subdirectories and missing files instead of omitting them.
52
52
- **Honeypot:** Fixed a bug where bot detection returned an HTTP 500 response instead of 403 (Forbidden).
53
+
- **I18n:** Fixed a bug where ``Time::today()``, ``Time::yesterday()``, and ``Time::tomorrow()`` ignored the specified ``$timezone`` and ``setTestNow()`` when calculating the day.
53
54
- **Logger:** Fixed a bug where interpolating a log message with array or non-stringable context values could raise PHP warnings or errors.
54
55
- **Cache:** Fixed ``MemcachedHandler::decrement()`` initializing a non-existent counter to the positive offset. Missing counters are now initialized to ``0``, reflecting Memcached's unsigned, saturating counter semantics.
0 commit comments