summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/openid/lib/Auth/Yadis/PlainHTTPFetcher.php')
-rw-r--r--plugins/openid/lib/Auth/Yadis/PlainHTTPFetcher.php29
1 files changed, 15 insertions, 14 deletions
diff --git a/plugins/openid/lib/Auth/Yadis/PlainHTTPFetcher.php b/plugins/openid/lib/Auth/Yadis/PlainHTTPFetcher.php
index 7a1bbba9..714fc265 100644
--- a/plugins/openid/lib/Auth/Yadis/PlainHTTPFetcher.php
+++ b/plugins/openid/lib/Auth/Yadis/PlainHTTPFetcher.php
@@ -49,7 +49,7 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$stop = time() + $this->timeout;
$off = $this->timeout;
- $headers = array();
+ $headers = [];
$code = '';
$body = '';
@@ -83,15 +83,16 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$user_agent = Auth_OpenID_USER_AGENT;
- $headers = array(
- "GET ".$parts['path'].
- (array_key_exists('query', $parts) ?
- "?".$parts['query'] : "").
- " HTTP/1.0",
- "User-Agent: $user_agent",
- "Host: ".$parts['host'].
- ($specify_port ? ":".$parts['port'] : ""),
- "Port: ".$parts['port']);
+ $headers = [
+ "GET " . $parts['path'] .
+ (array_key_exists('query', $parts) ?
+ "?" . $parts['query'] : "") .
+ " HTTP/1.0",
+ "User-Agent: $user_agent",
+ "Host: " . $parts['host'] .
+ ($specify_port ? ":" . $parts['port'] : ""),
+ "Port: " . $parts['port'],
+ ];
$errno = 0;
$errstr = '';
@@ -129,7 +130,7 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$http_code = explode(" ", $headers[0]);
$code = $http_code[1];
- if (in_array($code, array('301', '302'))) {
+ if (in_array($code, ['301', '302'])) {
$url = $this->_findRedirect($headers, $url);
$redir = true;
} else {
@@ -139,7 +140,7 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$off = $stop - time();
}
- $new_headers = array();
+ $new_headers = [];
foreach ($headers as $header) {
if (preg_match("/:/", $header)) {
@@ -164,7 +165,7 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$parts = parse_url($url);
- $headers = array();
+ $headers = [];
$post_path = $parts['path'];
if (isset($parts['query'])) {
@@ -239,7 +240,7 @@ class Auth_Yadis_PlainHTTPFetcher extends Auth_Yadis_HTTPFetcher {
$http_code = explode(" ", $headers[0]);
$code = $http_code[1];
- $new_headers = array();
+ $new_headers = [];
foreach ($headers as $header) {
if (preg_match("/:/", $header)) {