Making WordPress.org

Changeset 11629


Ignore:
Timestamp:
03/03/2022 07:25:56 AM (3 years ago)
Author:
dd32
Message:

Login: Trim \r off the block words before saving.

We're not trimming whitespace here, only splitting by \n, which caused the option to be updated with \r following all items.

This simply strips out the \r's before splitting for simplicity.

Follow up to r11620

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/ui.php

    r11623 r11629  
    139139        $block_words = wp_unslash( $_POST['registration_block_words'] ?? '' );
    140140        if ( $block_words ) {
     141            $block_words = str_replace( "\r", '', $block_words ); // We're not trimming the lines (So spaces before/after can be included to match full words only), but need to remove the 'arrrs.
    141142            $block_words = explode( "\n", $block_words );
    142143            $block_words = array_values( array_unique( array_filter( $block_words ) ) );
Note: See TracChangeset for help on using the changeset viewer.