Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/29/2015 03:40:09 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Use bp_sanitize_pagination_arg() in BP_Activity_Template and include related tests. This prevents pagination values from being overridden outside of anticipated boundaries. Props boonebgorges. See #5796.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r9406 r9411  
    215215        extract( $r );
    216216
    217         $this->pag_arg  = $r['page_arg'];
    218         $this->pag_page = isset( $_REQUEST[ $this->pag_arg ] ) ? intval( $_REQUEST[ $this->pag_arg ] ) : $page;
    219         $this->pag_num  = isset( $_REQUEST['num'] ) ? intval( $_REQUEST['num'] ) : $per_page;
     217        $this->pag_arg  = sanitize_key( $r['page_arg'] );
     218        $this->pag_page = bp_sanitize_pagination_arg( $this->pag_arg, $r['page']     );
     219        $this->pag_num  = bp_sanitize_pagination_arg( 'num',          $r['per_page'] );
    220220
    221221        // Check if blog/forum replies are disabled
Note: See TracChangeset for help on using the changeset viewer.