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/achievements.php +8 -8 8.0.0 → 8.0.5 View file →
@@ -850,27 +850,27 @@
850 850 $args = apply_filters( 'gamipress_get_achievement_earners_args', $args, $achievement_id );
851 851
852 852 $args = wp_parse_args( $args, $defaults );
853 853
854 + // Sanitization
855 + $args['limit'] = absint( $args['limit'] );
856 + $args['order'] = gamipress_validate_from_array( strtoupper( $args['order'] ), array( 'ASC', 'DESC' ), 'DESC' );
857 +
854 858 // Setup FROM
855 - if( ! empty( $args['from'] ) ) {
859 + if( ! empty( $args['from'] ) )
856 860 $from .= $args['from'];
857 - }
858 861
859 862 // Setup WHERE
860 - if( ! empty( $args['where'] ) ) {
863 + if( ! empty( $args['where'] ) )
861 864 $where .= $args['where'];
862 - }
863 865
864 866 // Setup LIMIT
865 - if( (int)( $args['limit'] ) > 0 ) {
867 + if( (int)( $args['limit'] ) > 0 )
866 868 $limit = '0, ' . $args['limit'];
867 - }
868 869
869 870 // Setup ORDER BY
870 - if( ! empty( $args['orderby'] ) ) {
871 + if( ! empty( $args['orderby'] ) )
871 872 $order_by = $args['orderby'] . ' ' . $args['order'];
872 - }
873 873
874 874 $earners = $wpdb->get_col(
875 875 "SELECT u.user_id
876 876 FROM {$from}