diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 39d6100d41..878b148d14 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3065,6 +3065,11 @@ function wp_targeted_link_rel_callback( $matches ) { */ $rel = apply_filters( 'wp_targeted_link_rel', 'noopener noreferrer', $link_html ); + // Avoid additional regex if the filter removes rel values. + if ( ! $rel ) { + return ""; + } + // Value with delimiters, spaces around are optional. $attr_regex = '|rel\s*=\s*?(\\\\{0,1}["\'])(.*?)\\1|i'; preg_match( $attr_regex, $link_html, $rel_match ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 105cdb4552..0a53ecae74 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-beta2-44690'; +$wp_version = '5.1-beta2-44691'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.