function getRedirectedUrl() { $this->res = HTTP::head($this->result_url); if (preg_match('/^3/', $this->res['response_code'])) { return $this->res['Location']; } return false; }
public static function head($url, $headers = array(), $auth = false) { $url = self::$config['apiURLPrefix'] . $url; if (self::$apiVersion) { $headers[] = "Zotero-API-Version: " . self::$apiVersion; } if (!$auth && self::$apiKey) { $headers[] = "Authorization: Bearer " . self::$apiKey; } $response = HTTP::head($url, $headers, $auth); return $response; }
public static function head($url, $headers = array(), $auth = false) { self::loadConfig(); $url = self::$config['apiURLPrefix'] . $url; $response = HTTP::head($url, $headers, $auth); return $response; }