larger issue is make_ubb_url isn't the go to for every forum URL that is generated. much like array_get is used to sanitize all inputs, make_ubb_url should also be a common funnel.
THEN we're cooking with gas, so to speak
also, in your code you have
$title = str_replace(array("-"), "-", $title); //remove dash
i don't see how that removes anything... replace dash with a dash? :shrug: