Skip to:
Content

bbPress.org

Changeset 7212


Ignore:
Timestamp:
10/11/2021 05:49:38 PM (7 weeks 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 trunk, for 2.7.

Fixes #3438.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/common/template.php

    r7190 r7212  
    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.