diff --git a/projects/plugins/jetpack/changelog/rnmobile-detect-invalid-urls b/projects/plugins/jetpack/changelog/rnmobile-detect-invalid-urls new file mode 100644 index 0000000000000..a0ac3ba002b1f --- /dev/null +++ b/projects/plugins/jetpack/changelog/rnmobile-detect-invalid-urls @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +RNMobile: Detect and avoid invalid media URLs in VideoPress v5 block diff --git a/projects/plugins/jetpack/extensions/blocks/videopress/edit.native.js b/projects/plugins/jetpack/extensions/blocks/videopress/edit.native.js index 63e35295f364d..e81a5d0df351b 100644 --- a/projects/plugins/jetpack/extensions/blocks/videopress/edit.native.js +++ b/projects/plugins/jetpack/extensions/blocks/videopress/edit.native.js @@ -206,7 +206,7 @@ class VideoPressEdit extends Component { onSelectURL( url ) { const { createErrorNotice, setAttributes, onReplace } = this.props; - if ( isURL( url ) ) { + if ( isURL( url ) && /^https?:/.test( getProtocol( url ) ) ) { // Check if there's an embed block that handles this URL. const embedBlock = createVideoPressEmbedBlock( { attributes: { url },