Skip to:
Content

bbPress.org

Changeset 7301


Ignore:
Timestamp:
06/25/2025 12:33:07 AM (11 months ago)
Author:
johnjamesjacoby
Message:

Moderation: prefer "disallowed_keys" over "disallow_keys".

This change corrects a regression (from r7270, since 2.6.11) where the incorrect option name was used when deprecating blacklist_keys via #3538.

Props robin-w.

In branches/2.6, for 2.6.14.

Fixes #3638.

Location:
branches/2.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/src/includes/common/functions.php

    r7270 r7301  
    843843 * @param string $title The title of the content
    844844 * @param string $content The content being posted
    845  * @param mixed  $strict  False for moderation_keys. True for disallow_keys.
     845 * @param mixed  $strict  False for moderation_keys. True for disallowed_keys.
    846846 *                        String for custom keys.
    847847 * @return bool True if test is passed, false if fail
     
    867867    if ( true === $strict ) {
    868868        $hook_name   = 'blacklist';
    869         $option_name = 'disallow_keys';
     869        $option_name = 'disallowed_keys';
    870870
    871871    // Non-strict uses WordPress "moderation" settings
  • branches/2.6/tests/phpunit/testcases/common/functions.php

    r7271 r7301  
    961961        $content        = 'Beware, they maybe bees hibernating.';
    962962
    963         update_option( 'disallow_keys',"hibernating\nfoo" );
     963        update_option( 'disallowed_keys',"hibernating\nfoo" );
    964964
    965965        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    967967        $this->assertFalse( $result );
    968968
    969         update_option( 'disallow_keys',"foo\nbar" );
     969        update_option( 'disallowed_keys',"foo\nbar" );
    970970
    971971        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    993993        $content        = bbp_get_topic_content( $t );
    994994
    995         update_option( 'disallow_keys',"http://example.net/banned\nfoo" );
     995        update_option( 'disallowed_keys',"http://example.net/banned\nfoo" );
    996996
    997997        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    10191019        $content        = bbp_get_topic_content( $t );
    10201020
    1021         update_option( 'disallow_keys',"banned@example.net\nfoo" );
     1021        update_option( 'disallowed_keys',"banned@example.net\nfoo" );
    10221022
    10231023        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    10431043        $content        = bbp_get_topic_content( $t );
    10441044
    1045         update_option( 'disallow_keys',"127.0.0.1\nfoo" );
     1045        update_option( 'disallowed_keys',"127.0.0.1\nfoo" );
    10461046
    10471047        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    10711071        $content        = bbp_get_topic_content( $t );
    10721072
    1073         update_option( 'disallow_keys',"hibernating\nfoo" );
     1073        update_option( 'disallowed_keys',"hibernating\nfoo" );
    10741074
    10751075        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    11021102        $content        = bbp_get_topic_content( $t );
    11031103
    1104         update_option( 'disallow_keys',"hibernating\nfoo" );
     1104        update_option( 'disallowed_keys',"hibernating\nfoo" );
    11051105
    11061106        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    11211121        $content        = 'Beware, there maybe bees <a href="http://example.com/hibernating/>buzzing</a>, buzzing.';
    11221122
    1123         update_option( 'disallow_keys',"hibernating\nfoo" );
     1123        update_option( 'disallowed_keys',"hibernating\nfoo" );
    11241124
    11251125        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
     
    11451145        $content        = bbp_get_topic_content( $t );
    11461146
    1147         update_option( 'disallow_keys',"hibernating\nfoo" );
     1147        update_option( 'disallowed_keys',"hibernating\nfoo" );
    11481148
    11491149        $result = bbp_check_for_moderation( $anonymous_data, $author_id, $title, $content, true );
Note: See TracChangeset for help on using the changeset viewer.