Based on https://github.com/zendframework/zend-diactoros/releases/tag/1.0.4 (commit 3a4ba1b4b9c1767727c58aef6ee5c2db3333d61c in this repo)
This is a security release.
A patch has been applied to `Laminas\Diactoros\Uri::filterPath()` that ensures that
paths can only begin with a single leading slash. This prevents the following
potential security issues:
- XSS vectors. If the URI path is used for links or form targets, this prevents
cases where the first segment of the path resembles a domain name, thus
creating scheme-relative links such as `//example.com/foo`. With the patch,
the leading double slash is reduced to a single slash, preventing the XSS
vector.
- Open redirects. If the URI path is used for `Location` or `Link` headers,
without a scheme and authority, potential for open redirects exist if clients
do not prepend the scheme and authority. Again, preventing a double slash
corrects the vector.
If you are using `Laminas\Diactoros\Uri` for creating links, form targets, or
redirect paths, and only using the path segment, we recommend upgrading
immediately.
Added
-----
- [zendframework/zend-diactoros#25](https://github.com/zendframework/zend-diactoros/pull/25) adds
documentation. Documentation is written in markdown, and can be converted to
HTML using [bookdown](http://bookdown.io). New features now MUST include
documentation for acceptance.
Deprecated
----------
- Nothing.
Removed
-------
- Nothing.
Fixed
-----
- [zendframework/zend-diactoros#51](https://github.com/zendframework/zend-diactoros/pull/51) fixes
`MessageTrait::getHeaderLine()` to return an empty string instead of `null` if
the header is undefined (which is the behavior specified in PSR-7).
- [zendframework/zend-diactoros#57](https://github.com/zendframework/zend-diactoros/pull/57) fixes the
behavior of how the `ServerRequestFactory` marshals upload files when they are
represented as a nested associative array.
- [zendframework/zend-diactoros#49](https://github.com/zendframework/zend-diactoros/pull/49) provides several
fixes that ensure that Diactoros complies with the PSR-7 specification:
- `MessageInterface::getHeaderLine()` MUST return a string (that string CAN be
empty). Previously, Diactoros would return `null`.
- If no `Host` header is set, the `$preserveHost` flag MUST be ignored when
calling `withUri()` (previously, Diactoros would not set the `Host` header
if `$preserveHost` was `true`, but no `Host` header was present).
- The request method MUST be a string; it CAN be empty. Previously, Diactoros
would return `null`.
- The request MUST return a `UriInterface` instance from `getUri()`; that
instance CAN be empty. Previously, Diactoros would return `null`; now it
lazy-instantiates an empty `Uri` instance on initialization.
- [ZF2015-05](https://getlaminas.org/security/advisory/ZF2015-05) was
addressed by altering `Uri::filterPath()` to prevent emitting a path prepended
with multiple slashes.