Skip to content

Look a media file up in the addressed weblog before loading its content - #346

Merged
mraible merged 1 commit into
roller-6.1.xfrom
scoped-media-file-lookup-6.1.x
Nov 20, 2026
Merged

mraible merged 1 commit into
roller-6.1.xfrom
scoped-media-file-lookup-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Follows up #329 from review, with the same change as the master follow-up to #308.

MediaResourceServlet loaded the file and its content with getMediaFile(id, true) and only then checked its weblog. It now looks the file up with getMediaFile(weblog, id), which finds only files in the weblog named in the address, and loads the content only after that.

Tests: MediaResourceServletTest now also checks that a file requested at another weblog's address is never loaded.

MediaResourceServlet loaded the file and its content with getMediaFile(id, true) and only then checked its weblog. It now looks the file up with getMediaFile(weblog, id), which finds only files in the weblog named in the address, and loads the content only after that.
@mraible
mraible requested a review from snoopdave November 18, 2026 04:16

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review of f04840d92: The scoped lookup precedes content loading, and the updated test would fail without that ordering. The twin PR has the same functional hunks; I found no unexplained difference.

No new issues found.

@mraible
mraible merged commit 104d510 into roller-6.1.x Nov 20, 2026
7 checks passed
@mraible
mraible deleted the scoped-media-file-lookup-6.1.x branch November 20, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants