Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/27/2014 05:01:01 PM (12 years ago)
Author:
johnjamesjacoby
Message:

In bp_core_time_since(), move the $pre_check into it's own line, and do an explicit comparison against it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r8701 r8702  
    705705 *        headers. Default: 302.
    706706 */
    707 function bp_core_redirect( $location, $status = 302 ) {
     707function bp_core_redirect( $location = '', $status = 302 ) {
    708708
    709709        // On some setups, passing the value of wp_get_referer() may result in an
    710710        // empty value for $location, which results in an error. Ensure that we
    711711        // have a valid URL.
    712         if ( empty( $location ) )
     712        if ( empty( $location ) ) {
    713713                $location = bp_get_root_domain();
     714        }
    714715
    715716        // Make sure we don't call status_header() in bp_core_do_catch_uri() as this
     
    742743        global $current_site;
    743744
    744         if ( is_multisite() )
     745        if ( is_multisite() ) {
    745746                $site_path = $current_site->path;
    746         else {
     747        } else {
    747748                $site_path = (array) explode( '/', home_url() );
    748749
    749                 if ( count( $site_path ) < 2 )
     750                if ( count( $site_path ) < 2 ) {
    750751                        $site_path = '/';
    751                 else {
     752                } else {
    752753                        // Unset the first three segments (http(s)://domain.com part)
    753754                        unset( $site_path[0] );
     
    755756                        unset( $site_path[2] );
    756757
    757                         if ( !count( $site_path ) )
     758                        if ( !count( $site_path ) ) {
    758759                                $site_path = '/';
    759                         else
     760                        } else {
    760761                                $site_path = '/' . implode( '/', $site_path ) . '/';
     762                        }
    761763                }
    762764        }
     
    778780 */
    779781function bp_core_current_time( $gmt = true, $type = 'mysql' ) {
    780         // Get current time
    781         $current_time = current_time( $type, $gmt );
    782 
    783         return apply_filters( 'bp_core_current_time', $current_time );
     782        return apply_filters( 'bp_core_current_time', current_time( $type, $gmt ) );
    784783}
    785784
     
    813812
    814813        // Use this filter to bypass BuddyPress's time_since calculations
    815         if ( $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date ) ) {
     814        $pre_value = apply_filters( 'bp_core_time_since_pre', false, $older_date, $newer_date );
     815        if ( false !== $pre_value ) {
    816816                return $pre_value;
    817817        }
Note: See TracChangeset for help on using the changeset viewer.