Skip to:
Content

bbPress.org

Changeset 3919


Ignore:
Timestamp:
05/22/2012 09:58:26 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Redirects:

  • Always use wp_safe_redirect() in bbPress.
  • Nothing should/will redirect off-site.
Location:
branches/plugin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-admin/bbp-replies.php

    r3824 r3919  
    494494     *                    data, action and message
    495495     * @uses add_query_arg() To add custom args to the url
    496      * @uses wp_redirect() Redirect the page to custom url
     496     * @uses wp_safe_redirect() Redirect the page to custom url
    497497     */
    498498    function toggle_reply() {
     
    535535            // Redirect back to the reply
    536536            $redirect = add_query_arg( $message, remove_query_arg( array( 'action', 'reply_id' ) ) );
    537             wp_redirect( $redirect );
     537            wp_safe_redirect( $redirect );
    538538
    539539            // For good measure
  • branches/plugin/bbp-admin/bbp-topics.php

    r3842 r3919  
    519519     *                    data, action and message
    520520     * @uses add_query_arg() To add custom args to the url
    521      * @uses wp_redirect() Redirect the page to custom url
     521     * @uses wp_safe_redirect() Redirect the page to custom url
    522522     */
    523523    function toggle_topic() {
     
    579579            // Redirect back to the topic
    580580            $redirect = add_query_arg( $message, remove_query_arg( array( 'action', 'topic_id' ) ) );
    581             wp_redirect( $redirect );
     581            wp_safe_redirect( $redirect );
    582582
    583583            // For good measure
  • branches/plugin/bbp-includes/bbp-reply-functions.php

    r3912 r3919  
    973973 * @uses bbp_get_reply_url() To get the reply url
    974974 * @uses add_query_arg() To add custom args to the reply url
    975  * @uses wp_redirect() To redirect to the reply
     975 * @uses wp_safe_redirect() To redirect to the reply
    976976 * @uses bbPress::errors:add() To log the error messages
    977977 */
     
    10851085
    10861086        // Redirect back to reply
    1087         wp_redirect( $reply_url );
     1087        wp_safe_redirect( $reply_url );
    10881088
    10891089        // For good measure
  • branches/plugin/bbp-includes/bbp-topic-functions.php

    r3911 r3919  
    10181018 *                    topic ids and source topic's forum id
    10191019 * @uses bbp_get_topic_permalink() To get the topic permalink
    1020  * @uses wp_redirect() To redirect to the topic link
     1020 * @uses wp_safe_redirect() To redirect to the topic link
    10211021 */
    10221022function bbp_merge_topic_handler() {
     
    12091209
    12101210        // Redirect back to new topic
    1211         wp_redirect( bbp_get_topic_permalink( $destination_topic->ID ) );
     1211        wp_safe_redirect( bbp_get_topic_permalink( $destination_topic->ID ) );
    12121212
    12131213        // For good measure
     
    12961296 *                    source topic ids and source topic's forum id
    12971297 * @uses bbp_get_topic_permalink() To get the topic permalink
    1298  * @uses wp_redirect() To redirect to the topic link
     1298 * @uses wp_safe_redirect() To redirect to the topic link
    12991299 */
    13001300function bbp_split_topic_handler() {
     
    15321532
    15331533        // Redirect back to the topic
    1534         wp_redirect( bbp_get_topic_permalink( $destination_topic->ID ) );
     1534        wp_safe_redirect( bbp_get_topic_permalink( $destination_topic->ID ) );
    15351535
    15361536        // For good measure
     
    15981598 * @uses do_action() Calls actions based on the actions with associated args
    15991599 * @uses is_wp_error() To check if the value retrieved is a {@link WP_Error}
    1600  * @uses wp_redirect() To redirect to the url
     1600 * @uses wp_safe_redirect() To redirect to the url
    16011601 */
    16021602function bbp_edit_topic_tag_handler() {
     
    18311831 * @uses bbp_get_topic_permalink() To get the topic link
    18321832 * @uses add_query_arg() To add args to the url
    1833  * @uses wp_redirect() To redirect to the topic
     1833 * @uses wp_safe_redirect() To redirect to the topic
    18341834 * @uses bbPress::errors:add() To log the error messages
    18351835 */
     
    19661966        }
    19671967
    1968         wp_redirect( $redirect );
     1968        wp_safe_redirect( $redirect );
    19691969
    19701970        // For good measure
  • branches/plugin/bbp-includes/bbp-user-functions.php

    r3918 r3919  
    433433 * @uses bbp_get_favorites_link() To get the favorites page link
    434434 * @uses bbp_get_topic_permalink() To get the topic permalink
    435  * @uses wp_redirect() To redirect to the url
     435 * @uses wp_safe_redirect() To redirect to the url
    436436 */
    437437function bbp_favorites_handler() {
     
    502502            }
    503503
    504             wp_redirect( $redirect );
     504            wp_safe_redirect( $redirect );
    505505
    506506            // For good measure
     
    750750 * @uses bbp_get_subscription_link() To get the subscription page link
    751751 * @uses bbp_get_topic_permalink() To get the topic permalink
    752  * @uses wp_redirect() To redirect to the url
     752 * @uses wp_safe_redirect() To redirect to the url
    753753 */
    754754function bbp_subscriptions_handler() {
     
    818818            }
    819819
    820             wp_redirect( $redirect );
     820            wp_safe_redirect( $redirect );
    821821
    822822            // For good measure
     
    849849 * @uses delete_option() To delete the displayed user's email id option
    850850 * @uses bbp_get_user_profile_edit_url() To get the edit profile url
    851  * @uses wp_redirect() To redirect to the url
     851 * @uses wp_safe_redirect() To redirect to the url
    852852 * @uses check_admin_referer() To verify the nonce and check the referer
    853853 * @uses current_user_can() To check if the current user can edit the user
     
    896896            delete_option( $user_id . '_new_email' );
    897897
    898             wp_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
     898            wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
    899899            exit;
    900900        }
     
    903903
    904904        delete_option( $user_id . '_new_email' );
    905         wp_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
     905        wp_safe_redirect( add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $user_id ) ) );
    906906        exit;
    907907
     
    962962        $redirect = add_query_arg( array( 'updated' => 'true' ), bbp_get_user_profile_edit_url( $edit_user ) );
    963963
    964         wp_redirect( $redirect );
     964        wp_safe_redirect( $redirect );
    965965        exit;
    966966    }
Note: See TracChangeset for help on using the changeset viewer.