You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the assign_new_user_avatar function is called with first parameter ($url_or_media_id) being an url string and not a numeric media id, the function throws and exception on line 959 when running under PHP 8 :
Uncaught TypeError: Unsupported operand types: string + int in /SomePath/simple-local-avatars/includes/class-simple-local-avatars.php:959
Stack trace:
#0 /SomePath/SimpleLocalAvatarPlugin.php(56): Simple_Local_Avatars->assign_new_user_avatar('...', 56)
...
Steps to Reproduce
Call programmatically the assign_new_user_avatar like this :
global $simple_local_avatars;
if ( isset( $simple_local_avatars ) ) {
$current_user = wp_get_current_user();
$simple_local_avatars->assign_new_user_avatar( 'some_url_string', $current_user->ID );
}
Describe the bug
When the
assign_new_user_avatar
function is called with first parameter ($url_or_media_id
) being an url string and not a numeric media id, the function throws and exception on line 959 when running under PHP 8 :Steps to Reproduce
assign_new_user_avatar
like this :Screenshots, screen recording, code snippet
No response
Environment information
No response
WordPress information
Wordpress 6.1.1
PHP 8.0.15
SimpleLocalAvatars 2.7.1
Code of Conduct
The text was updated successfully, but these errors were encountered: