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 a3f439f
Browse filesBrowse the repository at this point in the historyBrowse files
fix: remove leading slashes from sanitized relative paths
Remove leading forward slashes after filename filtering so relative mode cannot leave an absolute Unix path. Preserve internal and trailing separators and the default mode.
Add regression coverage for leading separators, traversal remnants, filtering, empty results, and the deprecated Security alias. Update the user guide and changelog.
Fixes#10815
Copy file name to clipboardExpand all lines: docs/changelogs/v4.7.7.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,8 @@ Release Date: Unreleased
23
23
24
24
## Bugs Fixed
25
25
26
+
-**Security Helper:** Fixed a bug where `sanitize_filename()` preserved leading forward slashes when `$relativePath` was `true`, including slashes exposed by removing parent-directory sequences. The same applies to `Security::sanitizeFilename()`.
27
+
26
28
-**API:** Fixed HTTP 500 errors in `ResponseTrait::paginate()` when using a Query Builder with a very large page number or `$perPage = 0`.
27
29
-**Cache:** Fixed a bug where `PredisHandler::increment()` and `PredisHandler::decrement()` updated the unused `'data'` hash field instead of `'__ci_value'`, causing `get()` to return stale values for existing counters.
28
30
-**CORS:** Fixed a bug where `Cors::hasResponseHeaders()` matched header substrings via `str_contains()`, causing false positives when existing exposed headers shared a prefix with configured exposed headers.
Copy file name to clipboardExpand all lines: docs/helpers/security_helper.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ The following functions are available:
28
28
29
29
Provides protection against directory traversal.
30
30
31
-
Backslashes are always removed. If `$relativePath` is `true`, forward slashes are preserved to allow relative paths such as `path/to/file.txt`, while parent-directory sequences (`../`) are removed.
31
+
Backslashes are always removed. If `$relativePath` is `true`, forward slashes are preserved to allow relative paths such as `path/to/file.txt`, while parent-directory sequences (`../`) and leading forward slashes are removed.
32
32
33
33
!!! note "Note"
34
34
When passing relative paths to this helper, use forward slashes (`/`) as directory separators, including on Windows.
0 commit comments