diff --git src/wp-admin/js/widgets/media-widgets.js src/wp-admin/js/widgets/media-widgets.js
index cd03b09633..81c7c72c26 100644
|
|
|
wp.mediaWidgets = ( function( $ ) { |
| 142 | 142 | /** |
| 143 | 143 | * Fetch media. |
| 144 | 144 | * |
| 145 | | * This is a TEMPORARY measure until the WP API supports an oEmbed proxy endpoint. See #40450. |
| 146 | | * |
| 147 | | * @see https://core.trac.wordpress.org/ticket/40450 |
| 148 | 145 | * @returns {void} |
| 149 | 146 | */ |
| 150 | 147 | fetch: function() { |
| … |
… |
wp.mediaWidgets = ( function( $ ) { |
| 154 | 151 | embedLinkView.dfd.abort(); |
| 155 | 152 | } |
| 156 | 153 | |
| | 154 | // Abort if the URL field was emptied out. |
| | 155 | if ( ! embedLinkView.model.get( 'url' ) ) { |
| | 156 | embedLinkView.setErrorNotice( '' ); |
| | 157 | return; |
| | 158 | } |
| | 159 | |
| 157 | 160 | fetchSuccess = function( response ) { |
| 158 | 161 | embedLinkView.renderoEmbed({ |
| 159 | 162 | data: { |
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 1bdc6e6575..75cf452f50 100644
|
|
|
EmbedUrl = View.extend({ |
| 4739 | 4739 | }, |
| 4740 | 4740 | |
| 4741 | 4741 | url: function( event ) { |
| 4742 | | this.model.set( 'url', event.target.value ); |
| | 4742 | this.model.set( 'url', $.trim( event.target.value ) ); |
| 4743 | 4743 | }, |
| 4744 | 4744 | |
| 4745 | 4745 | /** |
diff --git src/wp-includes/js/media/views/embed/url.js src/wp-includes/js/media/views/embed/url.js
index 3c99ca59ca..ab2863f1d0 100644
|
|
|
EmbedUrl = View.extend({ |
| 60 | 60 | }, |
| 61 | 61 | |
| 62 | 62 | url: function( event ) { |
| 63 | | this.model.set( 'url', event.target.value ); |
| | 63 | this.model.set( 'url', $.trim( event.target.value ) ); |
| 64 | 64 | }, |
| 65 | 65 | |
| 66 | 66 | /** |