Fix linkToPublic. Refs #8218
Also fix linkToAbsolute
Add tests for linkTo, linkToPublic, linkToRemote, linkToRemoteBase
Remove unused var
Merge pull request #8223 from owncloud/fix_linkToPublic

Fix linkToPublic and linkToAbsolute.