Skip to:
Content

bbPress.org

Changeset 5589


Ignore:
Timestamp:
01/10/2015 10:56:33 PM (10 years ago)
Author:
johnjamesjacoby
Message:

Use sanitize_key() in topics/functions.php to ensure values are within expected boundaries. See #2742.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/functions.php

    r5515 r5589  
    287287    // Check a whitelist of possible topic status ID's
    288288    } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( bbp_get_topic_statuses() ) ) ) {
    289         $topic_status = $_POST['bbp_topic_status'];
     289        $topic_status = sanitize_key( $_POST['bbp_topic_status'] );
    290290
    291291    // Default to published if nothing else
     
    630630    // Check a whitelist of possible topic status ID's
    631631    } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( bbp_get_topic_statuses() ) ) ) {
    632         $topic_status = $_POST['bbp_topic_status'];
     632        $topic_status = sanitize_key( $_POST['bbp_topic_status'] );
    633633
    634634    // Use existing post_status
     
    15041504    // How to Split
    15051505    if ( ! empty( $_POST['bbp_topic_split_option'] ) ) {
    1506         $split_option = (string) trim( $_POST['bbp_topic_split_option'] );
     1506        $split_option = sanitize_key( $_POST['bbp_topic_split_option'] );
    15071507    }
    15081508
Note: See TracChangeset for help on using the changeset viewer.