Make WordPress Core

Changeset 46396


Ignore:
Timestamp:
10/05/2019 12:55:48 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Comments: Remove a one-time variable in wp_rel_nofollow() and wp_rel_ugc().

See #48022.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r46349 r46396  
    30643064 */
    30653065function wp_rel_nofollow( $text ) {
    3066     // This is a pre save filter, so text is already escaped.
     3066    // This is a pre-save filter, so text is already escaped.
    30673067    $text = stripslashes( $text );
    3068     $rel  = 'nofollow';
    30693068    $text = preg_replace_callback(
    30703069        '|<a (.+?)>|i',
    3071         function( $matches ) use ( $rel ) {
    3072             return wp_rel_callback( $matches, $rel );
     3070        function( $matches ) {
     3071            return wp_rel_callback( $matches, 'nofollow' );
    30733072        },
    30743073        $text
     
    30993098 */
    31003099function wp_rel_ugc( $text ) {
    3101     // This is a pre save filter, so text is already escaped.
     3100    // This is a pre-save filter, so text is already escaped.
    31023101    $text = stripslashes( $text );
    3103     $rel  = 'nofollow ugc';
    31043102    $text = preg_replace_callback(
    31053103        '|<a (.+?)>|i',
    3106         function( $matches ) use ( $rel ) {
    3107             return wp_rel_callback( $matches, $rel );
     3104        function( $matches ) {
     3105            return wp_rel_callback( $matches, 'nofollow ugc' );
    31083106        },
    31093107        $text
Note: See TracChangeset for help on using the changeset viewer.