Opened 8 years ago
Last modified 6 months ago
#41349 new defect (bug)
Media Library insert from URL doesn't give a message when a URL fails check
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Media | Keywords: | ux-feedback needs-patch |
| Focuses: | Cc: |
Description
There is a check to see if something is a valid URL. This is awesome, but it doesn't give a message when fails. This is a weird user experience as you are left wondering what happened.
There is some strange behaviour, it sometimes has 'link text' vanishing, other times doesn't. It also can appear to flash as a block and then vanish. The logic of when the link text input shows or doesn't, seems a little confusing to work out.
What would be better would be to have a message when it's not a correct URL and check for inconsistencies in the link text input showing.
Change History (4)
This ticket was mentioned in Slack in #design by boemedia. View the logs.
8 years ago
This ticket was mentioned in Slack in #design by karmatosed. View the logs.
7 years ago
#4
@
6 months ago
- Keywords needs-patch added
Hi @karmatosed,
I have taken a look at this in the current state of WordPress, and whilst the steps to do this have changed within the block editor I can still replicate this issue today. As of such I have put in a bug report of the steps I took, which are very similar to your own.
Bug Report
Description
When adding an image to a page / post within the block editor there is no validation on the submitted url when inserting the image from a url. As of such this leads to broken image elements on the front end.
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.4.7
- Server: nginx/1.27.5
- Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.4.7)
- Browser: Chrome 137.0.0.0
- OS: macOS
- Theme: Twenty Seventeen 3.9
- MU Plugins: None activated
- Plugins:
- Test Reports 1.2.0
Steps to Reproduce
- Create a new post.
- Add in the image block to the page content.
- Click insert from url
- Enter an incorrect url, e.g. https://test
- 🐞 Bug occurs.
Expected Results
- ✅ Entering an incorrect/malformed url should flag up an error.
Actual Results
- ❌ The url was accepted and past that no checks where performed to see if the url was actually correct. These checks could be in the form of regex to confirm the url is formatted correctly, or a mime check on the returned data from fetching the url.
Additional Notes
Whilst there technically isn't much of an issue to the front end user, it does make sense to add a level of validation here so the user is aware of the issue sooner rather than later. If they do put in a malformed image url they will be able to see this very quickly within the editor / on the page, as the image will not display correctly, but we should be informing them at the point of entry, as opposed to later down the line.

#42419 was marked as a duplicate.