Opened 5 weeks ago
Closed 5 weeks ago
#8454 closed defect (bug) (fixed)
Rosetta: Fix permission handling, sanitize inputs, and improve list table accessibility
| Reported by: | timse201 | Owned by: | timse201 |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Translate Site & Plugins | Keywords: | has-patch |
| Cc: |
Description
Several improvements and bug fixes are needed across Rosetta roles:
- Bug Fixes:
- In edit-cross-locale-pte.php and edit-translation-editor.php, the hidden input for projects was missing an echo before esc_attr(), causing the value to be empty on form submission.
- In Cross_Locale_PTE::gp_pre_can_user_approve_translation(), the permission cache key did not include the translation_set_id, which could lead to incorrect permission caching across different sets.
- In views/cross-locale-pte.php, the capability check for adding a user used Rosetta_Roles::MANAGE_TRANSLATION_EDITORS_CAP instead of Cross_Locale_PTE::MANAGE_CROSS_LOCALE_PTES_CAP.
- Avoid PHP undefined index notices in Rosetta_Roles::send_email_notification() by checking isset().
- Sanitization:
- Sanitize and validate request variables (order, orderby, search query, role, user input, and project IDs) using sanitize_text_field(), sanitize_key(), absint(), and strict whitelists.
- Ensure usernames in action links are properly escaped.
- Accessibility and UI:
- Add hidden screen-reader text to list table row actions ("Edit", "Remove") with the corresponding username.
- Fix mismatched <label> elements in forms.
- Internationalize column headers and add empty table state messages.
- Hide the bulk action selector and checkbox column if the current user cannot manage editors.
- Performance:
- Cache parent project lookups in the list table ($parent_cache).
- Consolidate script and style enqueuing to admin_enqueue_scripts.
Change History (2)
Note:
See TracTickets
for help on using tickets.
https://github.com/WordPress/wordpress.org/pull/1024