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

Commit 0630c64

Browse files
committed
Merge branch 'hotfix/489'
Close #489
2 parents 852d228 + 5728778 commit 0630c64

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5-
## 2.0.4 - TBD
5+
## 2.0.4 - 2017-10-09
66

77
### Added
88

@@ -25,6 +25,10 @@ All notable changes to this project will be documented in this file, in reverse
2525
and 2.
2626
- [#482](https://github.com/zendframework/zend-expressive/pull/482) fixes the
2727
`Application::$defaultDelegate` dockblock Type.
28+
- [#489](https://github.com/zendframework/zend-expressive/pull/489) fixes an
29+
edge case in the `WhoopsErrorHandler` whereby it would emit an error if
30+
`$_SERVER['SCRIPT_NAME']` did not exist. It now checks for that value before
31+
attempting to use it.
2832

2933
## 2.0.3 - 2017-03-28
3034

src/Middleware/WhoopsErrorResponseGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,13 @@ private function prepareWhoopsHandler(ServerRequestInterface $request, PrettyPag
9292
$uri = $request->getAttribute('originalUri', false) ?: $request->getUri();
9393
$request = $request->getAttribute('originalRequest', false) ?: $request;
9494

95+
$serverParams = $request->getServerParams();
96+
$scriptName = isset($serverParams['SCRIPT_NAME']) ? $serverParams['SCRIPT_NAME'] : '';
97+
9598
$handler->addDataTable('Expressive Application Request', [
9699
'HTTP Method' => $request->getMethod(),
97100
'URI' => (string) $uri,
98-
'Script' => $request->getServerParams()['SCRIPT_NAME'],
101+
'Script' => $scriptName,
99102
'Headers' => $request->getHeaders(),
100103
'Cookies' => $request->getCookieParams(),
101104
'Attributes' => $request->getAttributes(),

0 commit comments

Comments
 (0)