diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/widgets/class-wp-widget-text.php --- a/wp/wp-includes/widgets/class-wp-widget-text.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/widgets/class-wp-widget-text.php Fri Sep 05 18:40:08 2025 +0200 @@ -44,7 +44,7 @@ } /** - * Add hooks for enqueueing assets when registering all widget instances of this widget class. + * Adds hooks for enqueueing assets when registering all widget instances of this widget class. * * @param int $number Optional. The unique order number of this widget instance * compared to other instances of the same class. Default -1. @@ -56,18 +56,20 @@ } $this->registered = true; - wp_add_inline_script( 'text-widgets', sprintf( 'wp.textWidgets.idBases.push( %s );', wp_json_encode( $this->id_base ) ) ); - if ( $this->is_preview() ) { add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_preview_scripts' ) ); } - // Note that the widgets component in the customizer will also do - // the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). + /* + * Note that the widgets component in the customizer will also do + * the 'admin_print_scripts-widgets.php' action in WP_Customize_Widgets::print_scripts(). + */ add_action( 'admin_print_scripts-widgets.php', array( $this, 'enqueue_admin_scripts' ) ); - // Note that the widgets component in the customizer will also do - // the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts(). + /* + * Note that the widgets component in the customizer will also do + * the 'admin_footer-widgets.php' action in WP_Customize_Widgets::print_footer_scripts(). + */ add_action( 'admin_footer-widgets.php', array( 'WP_Widget_Text', 'render_control_template_scripts' ) ); } @@ -103,7 +105,7 @@ } $wpautop = ! empty( $instance['filter'] ); - $has_line_breaks = ( false !== strpos( trim( $instance['text'] ), "\n" ) ); + $has_line_breaks = ( str_contains( trim( $instance['text'] ), "\n" ) ); // If auto-paragraphs are not enabled and there are line breaks, then ensure legacy mode. if ( ! $wpautop && $has_line_breaks ) { @@ -111,7 +113,7 @@ } // If an HTML comment is present, assume legacy mode. - if ( false !== strpos( $instance['text'], '