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

Commit e0ca271

Browse files
committed
Merge branch 'preg-explode-madness' of https://github.com/elazar/zf2 into hotfix/http-header-improvements
2 parents ea83bde + 2a29542 commit e0ca271

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Headers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static function fromString($string)
4545
$current = array();
4646

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

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

src/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static function fromString($string)
8686
{
8787
$request = new static();
8888

89-
$lines = preg_split('/\r\n/', $string);
89+
$lines = explode("\r\n", $string);
9090

9191
// first line must be Method/Uri/Version string
9292
$matches = null;

src/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ class Response extends Message implements ResponseDescription
175175
*/
176176
public static function fromString($string)
177177
{
178-
$lines = preg_split('/\r\n/', $string);
178+
$lines = explode("\r\n", $string);
179179
if (!is_array($lines) || count($lines)==1) {
180-
$lines = preg_split ('/\n/',$string);
180+
$lines = explode("\n",$string);
181181
}
182182

183183
$firstLine = array_shift($lines);

0 commit comments

Comments
 (0)