Hello,
It’s the same problem for me.
External links are broken. The href=”externallink.com” disappear after using the code.
I am not a developer, just a blogger who is looking for solutions, but something seems strange to me In this line :
$text = preg_replace('|]+http//))(?!([^>]+'.$domain.'))(.+)>|iU', '', $text);
It seems that all the content of ‘ a ‘ is replaced by ‘ a rel=”nofollow” target=”blank” ‘
So, the href=”…” disappear