Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into feature/http-header-cachecontrol-directives
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Header/ContentType.php
Expand Up @@ -58,7 +58,7 @@ class ContentType implements Header
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
list($name, $value) = preg_split('#: #', $headerLine, 2);
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
if (strtolower($name) !== 'content-type') {
Expand All @@ -74,7 +74,7 @@ public static function fromString($headerLine)

if (count($values)) {
foreach ($values as $keyValuePair) {
list($key, $value) = preg_split('/=/', $keyValuePair);
list($key, $value) = explode('=', $keyValuePair);
$value = trim($value, "\"\' \t\n\r\0\x0B");
$header->addParameter($key, $value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Date.php
Expand Up @@ -54,7 +54,7 @@ class Date implements Header
*/
public static function fromString($headerLine)
{
list($name, $value) = preg_split('#: #', $headerLine, 2);
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
if (strtolower($name) !== 'date') {
Expand Down
2 changes: 1 addition & 1 deletion src/Header/MimeVersion.php
Expand Up @@ -45,7 +45,7 @@ class MimeVersion implements Header
*/
public static function fromString($headerLine)
{
list($name, $value) = preg_split('#: #', $headerLine, 2);
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
if (strtolower($name) !== 'mime-version') {
Expand Down
3 changes: 1 addition & 2 deletions src/Header/Received.php
Expand Up @@ -52,8 +52,7 @@ class Received implements MultipleHeaderDescription
*/
public static function fromString($headerLine)
{

list($name, $value) = preg_split('#: #', $headerLine, 2);
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
if (strtolower($name) !== 'received') {
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Sender.php
Expand Up @@ -56,7 +56,7 @@ class Sender implements Header
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
list($name, $value) = preg_split('#: #', $headerLine, 2);
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
if (strtolower($name) !== 'sender') {
Expand Down
2 changes: 1 addition & 1 deletion src/Header/Subject.php
Expand Up @@ -53,7 +53,7 @@ class Subject implements Header, UnstructuredHeader
public static function fromString($headerLine)
{
$headerLine = iconv_mime_decode($headerLine, ICONV_MIME_DECODE_CONTINUE_ON_ERROR);
list($name, $value) = preg_split('#: #', $headerLine, 2);
list($name, $value) = explode(': ', $headerLine, 2);

// check to ensure proper header type for this factory
if (strtolower($name) !== 'subject') {
Expand Down
2 changes: 1 addition & 1 deletion src/Headers.php
Expand Up @@ -79,7 +79,7 @@ public static function fromString($string)
$current = array();

// iterate the header lines, some might be continuations
foreach (preg_split('#\r\n#', $string) as $line) {
foreach (explode("\r\n", $string) as $line) {

// check if a header name is present
if (preg_match('/^(?P<name>[^()><@,;:\"\\/\[\]?=}{ \t]+):.*$/', $line, $matches)) {
Expand Down

0 comments on commit 16b512c

Please sign in to comment.