Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions includes/entities/class-fs-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@ function __construct( $user = false ) {
*
* @return void
*/
function __wakeup() {
function __unserialize( $data ) {
if ( property_exists( $this, 'is_beta' ) ) {
// If we enter here, and we are running PHP 8.2, we already had the warning. But we sanitize data for next execution.
unset( $this->is_beta );
}
}

/**
* Compatibility wrapper of `__unserialize` for PHP < 7.4.
*/
function __wakeup() {
$this->__unserialize( array() );
}

function get_name() {
return trim( ucfirst( trim( is_string( $this->first ) ? $this->first : '' ) ) . ' ' . ucfirst( trim( is_string( $this->last ) ? $this->last : '' ) ) );
}
Expand All @@ -83,4 +90,4 @@ function is_beta() {
static function get_type() {
return 'user';
}
}
}