Skip to:
Content

bbPress.org

Changeset 7211


Ignore:
Timestamp:
10/11/2021 05:48:30 PM (3 years ago)
Author:
johnjamesjacoby
Message:

Topic Views: do not sanitize $view parameter of bbp_get_view_id().

(Removes the call to sanitize_key() inside of bbp_get_view_id().)

This change ensures that when checking for a registered view, the literal value is used for comparisons and not the sanitized version of it. This matches the behavior of other _get_*_id() functions, and also fixes a bug causing these invalid view IDs not to 404 as intended.

Props johnjamesjacoby, dd32.

In branches/2.6, for 2.6.7.

See #3438.

File:
1 edited

Legend:

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

    r7189 r7211  
    20492049
    20502050        // User supplied string
    2051         if ( ! empty( $view ) ) {
    2052             $view_id = sanitize_key( $view );
     2051        if ( ! empty( $view ) && is_string( $view ) ) {
     2052            $view_id = $view;
    20532053
    20542054        // Current view ID
Note: See TracChangeset for help on using the changeset viewer.