Making WordPress.org

Changeset 10917


Ignore:
Timestamp:
04/21/2021 05:26:06 AM (5 years ago)
Author:
dd32
Message:

Support: Don't respond with a 400 error when performing actions on spammed topics.

bbPress incorectly generates a link with p=1234/ (note the trailing slash) which triggers the blocking code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-bad-request.php

    r10529 r10917  
    7474
    7575            if ( isset( $must_be_num[ $field ] ) && ! empty( $vars[ $field ] ) && ! is_numeric( $vars[ $field ] ) ) {
     76
     77                // Allow the `p` variable to contain `p=12345/`: https://bbpress.trac.wordpress.org/ticket/3424
     78                if ( 'p' === $field && ( intval( $vars[ $field ] ) . '/' === $vars[ $field ] ) ) {
     79                    continue;
     80                }
     81
    7682                die_bad_request( "non-numeric $field in $ref" );
    7783            }
Note: See TracChangeset for help on using the changeset viewer.