From 0200a429c7a0315f6ac71887af98359dcd9ee754 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 5 Oct 2019 00:55:48 +0000 Subject: [PATCH] Comments: Remove a one-time variable in `wp_rel_nofollow()` and `wp_rel_ugc()`. See #48022. git-svn-id: https://develop.svn.wordpress.org/trunk@46396 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index ae772b8d0d..acc8de9188 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3063,13 +3063,12 @@ function wp_rel_callback( $matches, $rel ) { * @return string Converted content. */ function wp_rel_nofollow( $text ) { - // This is a pre save filter, so text is already escaped. + // This is a pre-save filter, so text is already escaped. $text = stripslashes( $text ); - $rel = 'nofollow'; $text = preg_replace_callback( '||i', - function( $matches ) use ( $rel ) { - return wp_rel_callback( $matches, $rel ); + function( $matches ) { + return wp_rel_callback( $matches, 'nofollow' ); }, $text ); @@ -3098,13 +3097,12 @@ function wp_rel_nofollow_callback( $matches ) { * @return string Converted content. */ function wp_rel_ugc( $text ) { - // This is a pre save filter, so text is already escaped. + // This is a pre-save filter, so text is already escaped. $text = stripslashes( $text ); - $rel = 'nofollow ugc'; $text = preg_replace_callback( '||i', - function( $matches ) use ( $rel ) { - return wp_rel_callback( $matches, $rel ); + function( $matches ) { + return wp_rel_callback( $matches, 'nofollow ugc' ); }, $text );