From 6cc26537d81d8812cf422293fbaf58ebaabd9980 Mon Sep 17 00:00:00 2001 From: Pavel Levin Date: Sun, 27 Sep 2015 18:12:31 +0300 Subject: [PATCH] Optimize headers parsing The server can not follow the RFC and use \n as separator instead \r\n --- src/drivers/php/Wappalyzer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/php/Wappalyzer.php b/src/drivers/php/Wappalyzer.php index d05ad19e9..2fcdd93d3 100644 --- a/src/drivers/php/Wappalyzer.php +++ b/src/drivers/php/Wappalyzer.php @@ -133,11 +133,11 @@ class Wappalyzer $headers = trim(substr($response, 0, $headerSize)); $headers = preg_split('/^\s*$/m', $headers); $headers = end($headers); - $lines = array_slice(explode("\r\n", $headers), 1); + $lines = array_slice(explode("\n", $headers), 1); foreach ( $lines as $line ) { if ( strpos(trim($line), ': ') !== false ) { - list($key, $value) = explode(': ', $line); + list($key, $value) = explode(': ', trim($line, "\r")); $result->headers[strtolower($key)] = $value; }