Fix: validate item type and rights in lifecycle actions - #213
Merged
Conversation
stonebuzz
requested changes
Aug 27, 2026
| $olditem = new $type(); | ||
| $olditem->getFromDB($olditem_id); | ||
| if (!$olditem->getFromDB($olditem_id) || !$olditem->can($olditem_id, UPDATE)) { | ||
| continue; |
Contributor
There was a problem hiding this comment.
New rights checks continue silently when an item fails, leaving the caller with no visibility into partial failures. $count is already incremented before the check (line 110), so the progress output counts skipped items as processed, and front/action.php unconditionally outputs "Replacement successful" after the call returns. A user replacing 10 items where 3 are denied gets the same feedback as a fully successful run.
The mass-action handler in inc/uninstall.class.php correctly uses MassiveAction::ACTION_NORIGHT; the replace() method should at minimum track and display skipped items in its HTML table, or return a count of failures to the caller.
stonebuzz
approved these changes
Aug 27, 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.
Checklist before requesting a review
Please delete options that are not relevant.
(no automated test suite exists in this plugin)
Description
Screenshots (if appropriate):