protected function getRedirectUrl(array $responseHeaders)
    {
        // Check for the redirect after authentication
        foreach ($responseHeaders as $header) {
            if ( preg_match('/^(Location:|URI:)\s*([^\s]+.*)$/', $header, $matches)
            ) {
                return trim(array_pop($matches));
            }
        }
        return null;
    }
protected function getRedirectUrl(array $responseHeaders)
    {
        // Check for the redirect after authentication
        foreach ($responseHeaders as $header) {
            if ( preg_match('/^(Location:|URI:)\s*([^\s]+.*)$/', $header, $matches)
            ) {
                return trim(array_pop($matches));
            }
        }
        return null;
    }
protected function getRedirectUrl ( array $ responseHeaders ) { // Check for the redirect after authentication foreach ( $ responseHeaders as $ header ) { if ( preg_match ( '/^(Location:|URI:)\s*([^\s]+.*)$/' , $ header , $ matches ) ) { return trim ( array_pop ( $ matches ) ) ; } } return null ; }
Answer a redirect URL if a redirect header is found, otherwise null.

@param array $responseHeaders response header to extract a redirect from

@return string or null
Answer a redirect URL if a redirect header is found otherwise null .