Skip to:

Opened 14 years ago

Closed 14 years ago

#2963 closed defect (bug) (duplicate)

XProfile - Bugs with the type datebox

Reported by: calvin_42's profile calvin_42 Owned by:
Milestone: 1.5 Priority: normal
Severity: Version: 1.5
Component: Extended Profile Keywords:


To record dates into the database, xprofile_screen_edit_profile() uses strtotime (Link).

The documentation stipulates :

''The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 UTC
to Tue, 19 Jan 2038 03:14:07 UTC''

There is 2 bugs in the current version of BuddyPress :

  • bp_get_the_profile_field_options() doesn't take this limits in account (Link) and display years 1900 and 1901 which cannot be saved.
  • If the user select the date January 1 1970, the strtotime result will be 0 and this value won't be saved because of the following test in xprofile_set_field_data() (Link)
/* If the value is empty, then delete any field data that exists */
if ( empty( $value ) ) {
	xprofile_delete_field_data( $field_id, $user_id );
	return true;

Moreover only the current and the past years are displayed. So the context is limited to displays birthdays or past events, not future ones.

IMHO, strtotime should be not used and the date should be serialized in string.

Change History (2)

#1 @DJPaul
14 years ago

  • Milestone changed from Awaiting Review to 1.3

See also #2946 and #2947

#2 @r-a-y
14 years ago

  • Keywords xprofile_screen_edit_profile strtotime bp_get_the_profile_field_options removed
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #2240.

Note: See TracTickets for help on using tickets.