Skip to:
Content

bbPress.org

Changeset 4655


Ignore:
Timestamp:
12/25/2012 08:00:36 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_get_redirect_to() to handle getting the request variable. Use this new function where appropriate.

Location:
trunk/includes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/common/functions.php

    r4588 r4655  
    228228
    229229/** Misc **********************************************************************/
     230
     231/**
     232 * Return the unescaped redirect_to request value
     233 *
     234 * @bbPress (r4655)
     235 *
     236 * @return string The URL to redirect to, if set
     237 */
     238function bbp_get_redirect_to() {
     239    $retval = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     240
     241    return apply_filters( 'bbp_get_redirect_to', $retval );
     242}
    230243
    231244/**
  • trunk/includes/common/template-tags.php

    r4622 r4655  
    11141114 * Output hidden request URI field for user forms.
    11151115 *
    1116  * The referer link is the current Request URI from the server super global. The
    1117  * input name is 'redirect_to', in case you wanted to check manually.
     1116 * The referer link is the current Request URI from the server super global. To
     1117 * check the field manually, use bbp_get_redirect_to().
    11181118 *
    11191119 * @since bbPress (r2815)
  • trunk/includes/forums/functions.php

    r4654 r4655  
    297297
    298298        // Redirect to
    299         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     299        $redirect_to  = bbp_get_redirect_to();
    300300
    301301        // Get the forum URL
     
    549549
    550550        // Redirect to
    551         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     551        $redirect_to = bbp_get_redirect_to();
    552552
    553553        // View all?
  • trunk/includes/replies/functions.php

    r4561 r4655  
    319319
    320320        // Redirect to
    321         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     321        $redirect_to = bbp_get_redirect_to();
    322322
    323323        // Get the reply URL
     
    604604
    605605        // Redirect to
    606         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     606        $redirect_to = bbp_get_redirect_to();
    607607
    608608        // Get the reply URL
     
    14171417
    14181418        // Redirect to
    1419         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     1419        $redirect_to = bbp_get_redirect_to();
    14201420
    14211421        // Get the reply URL
  • trunk/includes/topics/functions.php

    r4654 r4655  
    344344
    345345        // Redirect to
    346         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     346        $redirect_to = bbp_get_redirect_to();
    347347
    348348        // Get the topic URL
     
    682682
    683683        // Redirect to
    684         $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : '';
     684        $redirect_to = bbp_get_redirect_to();
    685685
    686686        // View all?
Note: See TracChangeset for help on using the changeset viewer.