		imagepng( $im_crop, $output );
	}

	$new_avatar = false;

	if ( file_exists( $output ) ) {

		$old_avatar = get_user_meta( $user_id, '_lp_profile_picture', true );

		if ( file_exists( $upload_dir['basedir'] . '/' . $old_avatar ) ) {
			@unlink( $upload_dir['basedir'] . '/' . $old_avatar );
		}

		$new_avatar = preg_replace( '!^/!', '', $upload_dir['subdir'] ) . '/' . $newname;
		update_user_meta( $user_id, '_lp_profile_picture', $new_avatar );
		update_user_meta( $user_id, '_lp_profile_picture_changed', 'yes' );

		$new_avatar = $upload_dir['baseurl'] . '/' . $new_avatar;
	}

	@unlink( $path );

	return $new_avatar;
}
The product uses an externally controlled name or reference that resolves to a resource that is outside of the intended control sphere.