Make WordPress Core

Opened 7 years ago

Closed 4 years ago

#42419 closed defect (bug) (duplicate)

Text widget accepts invalid media URL

Reported by: nirmalcm's profile nirmalcm Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8.3
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

I am noticed that text widget accepts invalid URL.

Steps to Repro:-
1) Select text widget from the “Appearance–>Widgets”
2) Click on “Add Media” button.
3) Click on “insert from URL”.
4) Add a invalid URL like “jnwfjkewwwnnwfkjfkjewkjfnkje”.
5) Click on “insert into post” button.
6) Click on “Done”

Attachments (1)

import_media_from_url_problem.jpg (105.4 KB) - added by mbelchev 7 years ago.

Download all attachments as: .zip

Change History (3)

#1 @mbelchev
7 years ago

  • Keywords needs-patch added

Seems like the error handling is not working properly. When you type an invalid URL the browser console is throwing an error but the user is not notified for it.

Also, the user is allowed to click "Insert into post" even there is a console error and the URL is invalid. So I confirm the reported bug by @nirmalcm

Attaching photo below.

Last edited 7 years ago by mbelchev (previous) (diff)

#2 @sabernhardt
4 years ago

  • Component changed from General to Media
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

@nirmalcm @mbelchev Thanks for the report and testing!

In addition to the Text widget, this also occurs in posts when using what is now the "Classic" editor. When a URL is invalid, the Link Title field (often) disappears, but you can still insert the invalid URL as a link into the post or widget.

Because I think you ultimately want a message notifying you of an invalid URL (and possibly disabling the Insert into post button), I'll mark this as a duplicate of #41349. If that is correct, please feel free to join the discussion there. If I'm wrong, please reopen this ticket.

Note: See TracTickets for help on using tickets.