Это
That "^M" is control-M, which is a carriage return, and is not needed in Unix file systems.
Они один "\n" прессуют, хотя там везде "\r\n"
$noauth = implode(' ', explode("\n", base64_decode($settings['no_auth_hosts'])));
можно так попробовать
$noauth = implode(' ', explode("\r\n", base64_decode($settings['no_auth_hosts'])));
или так
$noauth = base64_decode($settings['no_auth_hosts']);
$noauth = str_replace("\r\n", " ", $noauth);