Skip to content
Permalink
Browse files

Comments: Remove a one-time variable in `wp_rel_nofollow()` and `wp_r…

…el_ugc()`.

See #48022.

git-svn-id: https://develop.svn.wordpress.org/trunk@46396 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
SergeyBiryukov committed Oct 5, 2019
1 parent 56b6b1e commit 0200a429c7a0315f6ac71887af98359dcd9ee754
Showing with 6 additions and 8 deletions.
  1. +6 −8 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(
'|<a (.+?)>|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(
'|<a (.+?)>|i',
function( $matches ) use ( $rel ) {
return wp_rel_callback( $matches, $rel );
function( $matches ) {
return wp_rel_callback( $matches, 'nofollow ugc' );
},
$text
);

0 comments on commit 0200a42

Please sign in to comment.
You can’t perform that action at this time.