Normalized file permissions during replacement - #1110
Open
girishpanchal30 wants to merge 4 commits into
Open
Conversation
Collaborator
Collaborator
🌍 i18n String Review Report📊 Summary
➕ Added Strings (1) - Click to expand
|
Contributor
There was a problem hiding this comment.
Pull request overview
Normalizes permissions after media replacement to prevent inaccessible attachments.
Changes:
- Adds native
chmod()fallback and permission verification. - Returns a user-facing error when normalization fails.
- Adds a restricted-file permission test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
inc/media_rename/attachment_replace.php |
Implements permission normalization and failure reporting. |
tests/media_rename/test-attachment-replace.php |
Tests replacement of a 0600 file. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
inc/media_rename/attachment_replace.php:108
- This message is ambiguous: “it” appears to refer to the plural “permissions,” and “may not be updated” understates a failure that has already been verified. Name the replacement file explicitly and tell the user that manual action is required.
__( 'The permissions may not be updated, so it isn\'t publicly accessible. Please update the permissions.', 'optimole-wp' )
Soare-Robert-Daniel
approved these changes
Aug 17, 2026
selul
approved these changes
Aug 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Checked the file permissions and added a fallback to update them if the filesystem abstraction fails. If the permissions still cannot be updated, a message is returned asking the user to update them manually.
Closes #1107
Other information: