Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/24/2024 02:07:17 PM (22 months ago)
Author:
espellcaste
Message:

WPCS: The modified code addresses all WordPress.Security.SafeRedirect issues in the codebase.

All redirects in the codebase are now using the wp_safe_redirect() function, which validates and sanitizes the URLs, improving the overall security of the application.

Props imath
See #7228
Closes https://github.com/buddypress/buddypress/pull/290

File:
1 edited

Legend:

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

    r13842 r13871  
    476476         * @param string $redirect_to URL to redirect to.
    477477         */
    478         wp_redirect( apply_filters( 'bp_activity_admin_action_redirect', $redirect_to ) );
     478        wp_safe_redirect( apply_filters( 'bp_activity_admin_action_redirect', $redirect_to ) );
    479479        exit;
    480480
     
    496496        // If the activity doesn't exist, just redirect back to the index.
    497497        if ( empty( $activity->component ) ) {
    498             wp_redirect( $redirect_to );
     498            wp_safe_redirect( $redirect_to );
    499499            exit;
    500500        }
     
    608608         * @param string $redirect_to URL to redirect to.
    609609         */
    610         wp_redirect( apply_filters( 'bp_activity_admin_edit_redirect', $redirect_to ) );
     610        wp_safe_redirect( apply_filters( 'bp_activity_admin_edit_redirect', $redirect_to ) );
    611611        exit;
    612612
     
    614614    // If a referrer and a nonce is supplied, but no action, redirect back.
    615615    } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
    616         wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
     616        wp_safe_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
    617617        exit;
    618618    }
Note: See TracChangeset for help on using the changeset viewer.