PluginProbe
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI / 8.0.5
GamiPress – Gamification plugin to reward points, badges & ranks in WordPress, now with AI v8.0.5
8.0.5 8.0.4 8.0.3 8.0.1 8.0.2 8.0.0 7.9.9.7 7.9.9.6 7.9.9.5 7.9.9.4 7.9.9.3 7.9.9.2 7.9.9.1 7.9.9 7.9.8 7.9.7 7.9.6 7.9.5 7.9.4 7.9.3 7.9.2 7.9.1 7.9.0 7.8.9 7.8.8 All 47 releases
← All changes | includes/functions/ranks.php +8 -8 8.0.0 → 8.0.5 View file →
@@ -1011,27 +1011,27 @@
1011 1011 $args = apply_filters( 'gamipress_get_rank_earners_args', $args, $rank_id );
1012 1012
1013 1013 $args = wp_parse_args( $args, $defaults );
1014 1014
1015 + // Sanitization
1016 + $args['limit'] = absint( $args['limit'] );
1017 + $args['order'] = gamipress_validate_from_array( strtoupper( $args['order'] ), array( 'ASC', 'DESC' ), 'DESC' );
1018 +
1015 1019 // Setup FROM
1016 - if( ! empty( $args['from'] ) ) {
1020 + if( ! empty( $args['from'] ) )
1017 1021 $from .= $args['from'];
1018 - }
1019 1022
1020 1023 // Setup WHERE
1021 - if( ! empty( $args['where'] ) ) {
1024 + if( ! empty( $args['where'] ) )
1022 1025 $where .= $args['where'];
1023 - }
1024 1026
1025 1027 // Setup LIMIT
1026 - if( $args['limit'] > 0 ) {
1028 + if( $args['limit'] > 0 )
1027 1029 $limit = '0, ' . $args['limit'];
1028 - }
1029 1030
1030 1031 // Setup ORDER BY
1031 - if( ! empty( $args['orderby'] ) ) {
1032 + if( ! empty( $args['orderby'] ) )
1032 1033 $order_by = $args['orderby'] . ' ' . $args['order'];
1033 - }
1034 1034
1035 1035 $earners = $wpdb->get_col(
1036 1036 "SELECT u.user_id
1037 1037 FROM {$from}