Making WordPress.org

Changeset 12566


Ignore:
Timestamp:
05/02/2023 03:23:28 AM (3 years ago)
Author:
dd32
Message:

Support Forums: Consider links in reviews after the content filters have been applied.

The bbPress filter used for hooking this check to doesn't offer any context of the parsed reply/topic, which causes us to look at the raw POST fields.

This applies the bbPress filter to that content, as done within the new topic bbPress handler.

See #6964.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-ratings-compat.php

    r12012 r12566  
    349349        }
    350350
     351        $topic_content = false;
     352        if ( ! empty( $_POST['bbp_topic_content'] ) ) {
     353            // Apply the new-topic pre-content filters. This allows for various forum hooks to remove links.
     354            $topic_content = apply_filters( 'bbp_new_topic_pre_content', $_POST['bbp_topic_content'] );
     355        }
     356
    351357        if (
    352             ! empty( $_POST['bbp_topic_content'] ) &&
     358            $topic_content &&
    353359            (
    354                 false !== stripos( $_POST['bbp_topic_content'], 'https://' ) ||
    355                 false !== stripos( $_POST['bbp_topic_content'], 'http://' )
     360                false !== stripos( $topic_content, 'https://' ) ||
     361                false !== stripos( $topic_content, 'http://' )
    356362            )
    357363        ) {
Note: See TracChangeset for help on using the changeset viewer.