Skip to:
Content

BuddyPress.org

Changeset 7968


Ignore:
Timestamp:
02/22/2014 09:40:39 PM (11 years ago)
Author:
r-a-y
Message:

Don't use extract() in BP_Messages_Notice::get_notices().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-classes.php

    r7338 r7968  
    520520        global $wpdb, $bp;
    521521
    522         $defaults = array(
     522        $r = wp_parse_args( $args, array(
    523523            'pag_num'  => 20, // Number of notices per page
    524524            'pag_page' => 1   // Page number
    525         );
    526         $r = wp_parse_args( $args, $defaults );
    527         extract( $r );
     525        ) );
    528526
    529527        $limit_sql = '';
    530         if ( (int) $pag_num >= 0 ) {
    531             $limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $pag_page - 1 ) * $pag_num ), (int) $pag_num );
     528        if ( (int) $r['pag_num'] >= 0 ) {
     529            $limit_sql = $wpdb->prepare( "LIMIT %d, %d", (int) ( ( $r['pag_page'] - 1 ) * $r['pag_num'] ), (int) $r['pag_num'] );
    532530        }
    533531
Note: See TracChangeset for help on using the changeset viewer.