Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/19/2017 08:58:52 PM (2 years ago)
Author:
johnjamesjacoby
Message:

Anonymous: Improve $anonymous_data implementation:

  • Always treat it as an array, handling for false values was never used
  • Introduce _sanitize_ and _update_ partner functions for the existing _filter_ function
  • Ensure that cookies and meta-data values are stripped of invalid characters in the same way that anonymous comments are, to prevent inconsistencies between anonymous forum and commenter cookie data
  • Update surrounding documentation blocks
  • Prefer strict type-casting and is_array() comparisons
File:
1 edited

Legend:

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

    r6384 r6400  
    9898 * @uses current_user_can() To check if the current user can publish forum
    9999 * @uses bbp_get_current_user_id() To get the current user id
    100  * @uses bbp_filter_anonymous_post_data() To filter anonymous data
    101  * @uses bbp_set_current_anonymous_user_data() To set the anonymous user cookies
    102100 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    103101 * @uses bbp_is_forum_category() To check if the forum is a category
     
    135133
    136134    // Define local variable(s)
    137     $view_all = $anonymous_data = false;
     135    $view_all = false;
    138136    $forum_parent_id = $forum_author = 0;
    139137    $forum_title = $forum_content = '';
     138    $anonymous_data = array();
    140139
    141140    /** Forum Author **********************************************************/
     
    363362 * @uses bbp_is_forum_anonymous() To check if forum is by an anonymous user
    364363 * @uses current_user_can() To check if the current user can edit the forum
    365  * @uses bbp_filter_anonymous_post_data() To filter anonymous data
    366364 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    367365 * @uses bbp_is_forum_category() To check if the forum is a category
Note: See TracChangeset for help on using the changeset viewer.