@@ -168,20 +168,20 @@ |
||
168 | 168 | foreach (explode("\n", $raw_headers) as $i => $h) { |
169 | 169 | $h = explode(':', $h, 2); |
170 | 170 | if (isset($h[1])) { |
171 | - if (!isset($headers[$h[0]])) { |
|
172 | - $headers[$h[0]] = trim($h[1]); |
|
173 | - } elseif (is_array($headers[$h[0]])) { |
|
174 | - $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); |
|
175 | - } else { |
|
176 | - $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); |
|
177 | - } |
|
178 | - $key = $h[0]; |
|
171 | + if (!isset($headers[$h[0]])) { |
|
172 | + $headers[$h[0]] = trim($h[1]); |
|
173 | + } elseif (is_array($headers[$h[0]])) { |
|
174 | + $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); |
|
175 | + } else { |
|
176 | + $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); |
|
177 | + } |
|
178 | + $key = $h[0]; |
|
179 | 179 | } else { |
180 | - if (substr($h[0], 0, 1) == "\t") { |
|
181 | - $headers[$key] .= "\r\n\t".trim($h[0]); |
|
182 | - } elseif (!$key) { |
|
183 | - $headers[0] = trim($h[0]); |
|
184 | - } |
|
180 | + if (substr($h[0], 0, 1) == "\t") { |
|
181 | + $headers[$key] .= "\r\n\t".trim($h[0]); |
|
182 | + } elseif (!$key) { |
|
183 | + $headers[0] = trim($h[0]); |
|
184 | + } |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | return $headers; |
@@ -131,7 +131,7 @@ |
||
131 | 131 | case 'GET': |
132 | 132 | curl_setopt($ch, CURLOPT_HTTPGET, true); |
133 | 133 | if (!empty($params)) { |
134 | - $url .= '?' . http_build_query($params); |
|
134 | + $url .= '?'.http_build_query($params); |
|
135 | 135 | curl_setopt($ch, CURLOPT_URL, $url); |
136 | 136 | } |
137 | 137 | break; |