Fix IHTTPResult::getHeader/s()
- Split functionality "getHeader()" and "getHeaders()" analog to IMessageInterface::getHeader/s() - Fix functionality at various places - Adapt CurlResultTest
This commit is contained in:
parent
fff94563d7
commit
933ea7c9ce
11 changed files with 96 additions and 28 deletions
|
@ -175,7 +175,6 @@ class ParseUrl
|
|||
return $siteinfo;
|
||||
}
|
||||
|
||||
$header = $curlResult->getHeader();
|
||||
$body = $curlResult->getBody();
|
||||
|
||||
if ($do_oembed) {
|
||||
|
@ -204,7 +203,7 @@ class ParseUrl
|
|||
$charset = '';
|
||||
// Look for a charset, first in headers
|
||||
// Expected form: Content-Type: text/html; charset=ISO-8859-4
|
||||
if (preg_match('/charset=([a-z0-9-_.\/]+)/i', $header, $matches)) {
|
||||
if (preg_match('/charset=([a-z0-9-_.\/]+)/i', $curlResult->getContentType(), $matches)) {
|
||||
$charset = trim(trim(trim(array_pop($matches)), ';,'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue