Use CurlResult->getHeaderArray instead of custom conversion
This commit is contained in:
parent
54600b5f2b
commit
9e143287d6
|
@ -88,16 +88,8 @@ function parse_url_content(App $a)
|
||||||
$curlResponse = DI::httpRequest()->head($url);
|
$curlResponse = DI::httpRequest()->head($url);
|
||||||
|
|
||||||
if ($curlResponse->isSuccess()) {
|
if ($curlResponse->isSuccess()) {
|
||||||
// Convert the header fields into an array
|
$hdrs = $curlResponse->getHeaderArray();
|
||||||
$hdrs = [];
|
|
||||||
$h = explode("\n", $curlResponse->getHeader());
|
|
||||||
foreach ($h as $l) {
|
|
||||||
$header = array_map('trim', explode(':', trim($l), 2));
|
|
||||||
if (count($header) == 2) {
|
|
||||||
list($k, $v) = $header;
|
|
||||||
$hdrs[$k] = $v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$type = null;
|
$type = null;
|
||||||
$content_type = '';
|
$content_type = '';
|
||||||
$bbcode = '';
|
$bbcode = '';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user