Do only follow HTTP and HTTPS redirects

We do not want to follow redirects to other protocols since they might allow an adversary to bypass network restrictions. (i.e. a redirect to ftp:// might be used to access files of a FTP server which might be in a secure zone and not be reachable from the net but from the ownCloud server)
There is a performance difference between isset() and array_key_exists(). As such, isset should be prefered when the difference in behaviour between the two is not required (see http://php.net/manual/en/function.array-key-exists.php). isset should use constant time hashmap lookup while array_key_exists() performs array traversion.