Skip to content

Harden thumbnail paths and cover failure cases - #3

Draft
liikane wants to merge 2 commits into
mainfrom
copilot/liikane-doneproject-1-review-fix
Draft

liikane wants to merge 2 commits into
mainfrom
copilot/liikane-doneproject-1-review-fix

Conversation

@liikane

@liikane liikane commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Review of the PHPUnit changes identified a path-boundary flaw that could accept files in a sibling directory, ignored thumbnail resize failures, and missing REST authorization regression coverage.

  • Constrain upload paths: Require resolved files to be inside the uploads directory, not merely share its prefix.
    $prefix = rtrim( $basedir_real, DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR;
  • Handle resize failures: Return the original image when resizing fails; don’t attempt to save the thumbnail.
  • Add focused regressions: Cover sibling-directory rejection, resize failure fallback, and REST read-capability checks.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@liikane liikane changed the title [WIP] Review and fix issues found in PHPUnit PR #1 Harden thumbnail paths and cover failure cases Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Copilot] Kontrolli olemasolevat PHPUnit PR #1 ja paranda tuvastatud probleemid

2 participants