Append port to trusted domain in case it's not 80 or 443

See https://github.com/owncloud/core/pull/10584#issuecomment-54677059 for reference.

@ronnicek Can you please test this change? Thanks.

\cc @MTRichards FYI. 
>How is changing return to exit related to "Append port to trusted domain in case it's not 80 or 443"?

It's related to "it didn't work before and if we create a PR for every tiny little change we will never get anywhere" ;-)