Opened 11 years ago
Closed 10 years ago
#5335 closed defect (bug) (no action required)
Problem with Retrieving avatar's
Reported by: | vusisindane | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.9.1 |
Component: | Core | Keywords: | |
Cc: |
Description
I'm using buddypress 1.9.1 and here's the problem.
After submitting the cropped image, inside wp-core-avatars.php in
bp_core_avatar_handle_crop(), buddypress uses wp_crop_image() to resize.
The trouble is,
--> wordpress uses wp_unique_filename() inside wp_crop_image()
the function santize_file_name() changes the destination file and removes the buddypress suffix "-bpfull" and "-bpthumb" that were added in the bp_core_avatar_handle_crop() function.
So when the cropped images are set, buddypress cannot find them using the bp_core_fetch_avatar() function because it specifically looks for images with those suffixes (-bpthumb & -bpfull) respectively.
So after uploading and cropping an image, I can find it in the directioty "wp-content/uploads/avatar/#/", but bp cannot retrieve it because the file does not have the correct suffix i.e. (-bpthumb or -bpfull).
Hope this makes sense.
Change History (5)
#2
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Thanks for the report and for the code. I've never heard of this problem before, and it's not clear to me why sanitize_file_name() would strip the '-bpfull' and '-bpthumb' suffixes.
In any case, please don't mark the ticket fixed until/unless it's been verified that (a) there's a real bug, and (b) it's been fixed in BuddyPress. Thanks.
#3
@
11 years ago
- Keywords reporter-feedback added
Hi vusisindane - I've taken a closer look, and I can't manage to reproduce the underlying issue. Is there a chance that you've done more debugging to see why sanitize_file_name()
is stripping the suffix on your setup? Do you have a plugin that is filtering 'sanitize_file_name' in some way? If you could trace the path of the issue through that function, it'd be most helpful. Thanks.
#4
@
11 years ago
i'll do that.
I'm also not sure why this is happening. Perhaps you're right, there's a plugin somewhere that strips -bpfull. it's actually not stripping the suffix, it's returning a GUID all together.
I'll have a look in my code because I tend to borrow functions and snippets from stack-over-flow without really testing them in details.
Thanks for the acknowledgement...
#5
@
10 years ago
- Keywords reporter-feedback removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from reopened to closed
Going to close this as we couldn't recreate and haven't heard from the original reporter (about getting some debug information from their site) in the last six months.
Here's a temporary fix I've come up with.
Enjoy