PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-a.1
Jetpack – WP Security, Backup, Speed, & Growth v16.3-a.1
16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 All 504 releases
← All changes | modules/videopress/editor-media-view.php +7 -3 12.2.3 → 16.3-a.1 View file →
@@ -6,8 +6,12 @@
6 6 */
7 7
8 8 use Automattic\Jetpack\Assets;
9 9
10 +if ( ! defined( 'ABSPATH' ) ) {
11 + exit( 0 );
12 +}
13 +
10 14 /**
11 15 * WordPress Shortcode Editor View JS Code
12 16 */
13 17 function videopress_handle_editor_view_js() {
@@ -122,9 +126,9 @@
122 126
123 127 /**
124 128 * Make sure that any Video that has a VideoPress GUID passes that data back.
125 129 *
126 - * @param WP_Post $post Attachment object.
130 + * @param array $post Attachment data array.
127 131 * @deprecated 11.4
128 132 */
129 133 function videopress_prepare_attachment_for_js( $post ) {
130 134 _deprecated_function( __METHOD__, 'jetpack-11.4' );
@@ -214,12 +218,12 @@
214 218 */
215 219 function videopress_media_send_to_editor( $html, $id, $attachment ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
216 220 $videopress_guid = get_post_meta( $id, 'videopress_guid', true );
217 221 if ( $videopress_guid && videopress_is_valid_guid( $videopress_guid ) ) {
218 - if ( '[video ' === substr( $html, 0, 7 ) ) {
222 + if ( str_starts_with( $html, '[video ' ) ) {
219 223 $html = sprintf( '[videopress %1$s]', esc_attr( $videopress_guid ) );
220 224
221 - } elseif ( '<a href=' === substr( $html, 0, 8 ) ) {
225 + } elseif ( str_starts_with( $html, '<a href=' ) ) {
222 226 // We got here because `wp_attachment_is()` returned false for
223 227 // video, because there isn't a local copy of the file.
224 228 $html = sprintf( '[videopress %1$s]', esc_attr( $videopress_guid ) );
225 229 }