Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/13/2016 09:14:06 PM (3 years ago)
Author:
r-a-y
Message:

Core: Fix fatal error with bp_core_get_iso8601_date() when an invalid date string is passed.

This error occurred on the Members Directory and selecting the
"Alphabetical" filter when attempting to parse an inactive user's last
activity. Inactive users passes the "Never active" string to
bp_core_get_iso8601_date() and the DateTime class causes a fatal
error on invalid date strings, unless we catch the exception, which this
commit is now doing.

See #5757.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/core/functions.php

    r11082 r11097  
    254254
    255255        $this->assertEquals( 'March 18, 2014 at 7:00 pm', bp_format_time( $time, $just_date, $localize_time ) );
     256    }
     257
     258    /**
     259     * @group bp_core_get_iso8601_date
     260     */
     261    public function test_bp_core_get_iso8601_date_invalid_date() {
     262        $this->assertEquals( '', bp_core_get_iso8601_date( 'Not a date' ) );
    256263    }
    257264
Note: See TracChangeset for help on using the changeset viewer.