This is a (multiple allowed):
What you did
Use $this->request->referer(true) when the referer is our home (/) crashes under PHP7 with the error Uninitialized string offset: 0.
The problem is in this line of the Request@referer method:
if ($local && strpos($ref, $base) === 0) {
$ref = substr($ref, strlen($base));
if ($ref[0] !== '/') {
$ref = '/' . $ref;
}
return $ref;
}
$ref is an empty string due to the substr($ref, strlen($base)).
Expected Behavior
referer should be returning /
Actual Behavior
Crashes with the error Uninitialized string offset: 0.
I'm just creating a PR with the fix and its test. BTW, I'm not sure about how I've fixed, but let's discuss it on the PR.