Automattic / Automattic/jetpack
Images in search results still use relative URLs when "Photonized" leading to a 400 error
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
### Impacted plugin
Search
### Quick summary
Reported by user via ticket:
7109073-zd-a8c
Images do not display in the search results as expected with search term like `Tropheus moorii bemba`
Images in search results still use relative URLs when "Photonized" leading to a 400 error.
Additionally, we tested by searching `fish`, which some images do display in the search results. As they are external and have fully qualified URL.
### Steps to reproduce
1. Go to https://cichlidae.org.ua/
2. Search `Tropheus moorii bemba`
3. Search results do not display images (will report in a separate issue), exposing alt text showing Cyrillic encoding error.
When the author of site uses relative paths for images in post, WordPress renders the images properly. But Jetpack search doesn't generate the proper Photon URL. Jetpack Search should be using a fully qualified URL. (add site host name)
Example:
In search results (https://cichlidae.org.ua/?s=Tropheus%20moorii%20bemba) 3rd item "[Група Tropheus sp. "black"]:
https://i1.wp.com/images/Tropheus/Tropheus_sp._Rutunga.jpg?resize=600%2C600
In post content (https://cichlidae.org.ua/tropheus-black-group/):
/images/Tropheus/Tropheus_sp._Rutunga.jpg
### A clear and concise description of what you expected to happen.
I expect the images to display in the search results, as the images work in the page when the result is clicked.
### What actually happened
The images did not display correctly in the search results, only in the post content.
### Impact
One
### Available workarounds?
No but the platform is still usable
### Platform (Simple and/or Atomic)
Self-hosted
### Logs or notes
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.