Validate attachment rights on listing media AJAX - #538
sorinmarta wants to merge 3 commits into
Conversation
Fixes #371 Authenticated listing image attach and delete now require per-attachment capabilities.
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Warning Review limit reachedNext included review available in 40 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughChangesListing media authorization
Priority: ➖ Normal Estimated code review effort: 4 (Complex) | ~45 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Client
participant ajax_listing_media_image
participant WPBDP_Listing_Image
participant Listing
Client->>ajax_listing_media_image: submit image IDs
ajax_listing_media_image->>WPBDP_Listing_Image: normalize and validate images
WPBDP_Listing_Image->>Listing: check ownership and capabilities
Listing-->>WPBDP_Listing_Image: authorization result
ajax_listing_media_image->>Client: return filtered HTML or error
🚥 Pre-merge checks | ✅ 4 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The pull request claims to fix issue Full details: Linked Issues checkExplanation Issue Resolution Implement the coding requirements in issue Full details: Out of Scope Changes checkExplanation The PR changes AJAX listing-image attachment and deletion authorization, adds image ownership and capability checks, gates the media selector, and adds authorization tests. These changes support listing-media security, but they have no stated connection to issue ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes phpdoc grouping and converts AJAX wp_die into a catchable exception.
wp_attachment_is_image requires an attached file, so success paths now upload one.
Fixes https://github.com/Strategy11/business-directory-premium/issues/371
Authenticated listing image attach and delete now require per-attachment capabilities.