In `EmbedLink`, a URL needs to be at least 11 chars to be useful.

Fixes #32059.


git-svn-id: https://develop.svn.wordpress.org/trunk@32463 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-05-08 20:29:55 +00:00
parent bbcddbbb72
commit 3fd2730435
2 changed files with 6 additions and 4 deletions

View File

@ -4543,8 +4543,9 @@ EmbedLink = wp.media.view.Settings.extend({
this.$('.embed-container').hide().find('.embed-preview').empty();
this.$( '.setting' ).hide();
// only proceed with embed if the field contains more than 6 characters
if ( url && ( url.length < 6 || ! url.match(/^http(s)?:\/\//) ) ) {
// only proceed with embed if the field contains more than 11 characters
// Example: http://a.io is 11 chars
if ( url && ( url.length < 11 || ! url.match(/^http(s)?:\/\//) ) ) {
return;
}

View File

@ -27,8 +27,9 @@ EmbedLink = wp.media.view.Settings.extend({
this.$('.embed-container').hide().find('.embed-preview').empty();
this.$( '.setting' ).hide();
// only proceed with embed if the field contains more than 6 characters
if ( url && ( url.length < 6 || ! url.match(/^http(s)?:\/\//) ) ) {
// only proceed with embed if the field contains more than 11 characters
// Example: http://a.io is 11 chars
if ( url && ( url.length < 11 || ! url.match(/^http(s)?:\/\//) ) ) {
return;
}