Merge pull request #8359 from phlyper/patch-1

verify exists index 0 in $ref
This commit is contained in:
Mark Story 2016-03-02 12:27:49 -05:00
commit 63de5ca4ea

View file

@ -448,7 +448,7 @@ class CakeRequest implements ArrayAccess {
if (!empty($ref) && !empty($base)) {
if ($local && strpos($ref, $base) === 0) {
$ref = substr($ref, strlen($base));
if ($ref[0] !== '/') {
if (isset($ref[0]) && $ref[0] !== '/') {
$ref = '/' . $ref;
}
return $ref;