Opened 10 years ago
Closed 9 years ago
#6081 closed defect (bug) (fixed)
Slashes in Group description on Profile Administration screen
Reported by: | imath | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.4 | Priority: | normal |
Severity: | major | Version: | |
Component: | Extended Profile | Keywords: | has-patch |
Cc: | mahype |
Attachments (3)
Change History (9)
#1
@
10 years ago
- Keywords needs-patch good-first-bug added; has-patch removed
- Milestone changed from Awaiting Review to Future Release
#3
@
9 years ago
- Keywords has-patch added; needs-patch good-first-bug removed
- Milestone changed from Future Release to 2.4
- Priority changed from low to normal
- Severity changed from minor to major
Okay, this was fun. Maybe not a good-first-bug due to its complexity, but @mahype and I had fun exploring this issue at Wordcamp Europe contributor day. :)
1) Patch adds filters to parts of the xprofile wp-admin templates so we're running group description and name through the same output filters that are used in the front-end template parts (for stripslashes).
2) This change revealed another bug where we are storing slashes in the database (this is a known issue and we have somewhere a very old ticket), but in this case, after applying the fix in 1), editing a profile group name or description multiple times would show the extra slashes again in the templates (only stripping the first slash).
So the patch adds a stripslashes to profile group name and description before_save filters to fix the root issue.
Keeping the existing on-display stripslashes maintains backwards compatibility.
3) Which revealed a fun bug where, if you save a profile group without changing *any* details, it didn't work and we threw an error. It looks like someone misinterpreted the return values of WPDB's query
and get_results
functions. So this was corrected.
No unit tests, but it's now time for a siesta. :)
I think using the
bp_get_group_description
filter here would be more appropriate and inline with how the group description would normally be rendered.