Fixing WordPress 6.0

The long-awaited WordPress 6.0 update is here, but not all is well. I've been waiting for this update in hopes it would cure the PHP error messages filling up my logs. Nineteen deprecated errors per page.
Well, I did the upgrade today and ten of those errors are gone, but nine remain. Good work guys. Fortunately, and surprisingly, it is actually just a single error that occurs nine times. The offending code is in wp-includes/formatting.php line 2772.
function untrailingslashit( $string ) {
return rtrim( $string, '/\\' );
}
A null string is being passed which is no longer allowed. The real problem would seem to be that this should not be called if the string is null, but I don't have time to track down the cause, so I put a bandage on the symptom. I added code to avoid rtrim() if the string is null.
function untrailingslashit( $string ) {
if(is_null($string)){
return $string;
} else {
return rtrim( $string, '/\\' );
}
}
This takes care of the error messages.
It really bothers me that WordPress is more concerned with making their product more and more complicated while ignoring the basics like not having error messages.