Skip to content

Commit

Permalink
SECURITY-480: build fix
Browse files Browse the repository at this point in the history
Co-authored-by: Laszlo Losonczy <laszlo.losonczy@emarsys.com>
  • Loading branch information
knagy and losonczylaci committed Jun 14, 2024
1 parent 08c101f commit ed14aff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ build: ; docker compose build
install: ; docker compose run --rm web composer install
update: ; docker compose run --rm web composer update

test: ; docker compose run --rm web composer test
test: ; docker compose run --rm web php -d error_reporting=E_ALL ./vendor/bin/phpunit --do-not-cache-result -c phpunit.xml
test-only: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result --group only -c phpunit.xml

17 changes: 8 additions & 9 deletions src/Escher/RequestHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,15 @@ public function getHeaderList()
$headerList = $this->process($this->serverVars);
$headerList['content-type'] = $this->getContentType();

if (strpos($headerList['host'], ':') === false)
{
$host = $headerList['host'];
$port = null;
}
else
{
list($host, $port) = explode(':', $headerList['host'], 2);
if (isset($headerList['host'])) {
if (strpos($headerList['host'], ':') === false) {
$host = $headerList['host'];
$port = null;
} else {
list($host, $port) = explode(':', $headerList['host'], 2);
}
$headerList['host'] = $this->normalizeHost($host, $port);
}
$headerList['host'] = $this->normalizeHost($host, $port);

return $headerList;
}
Expand Down

0 comments on commit ed14aff

Please sign in to comment.