mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
verify exists index 0 in $ref
exemple i have to get the referrer url from any page if exists ``` class AppController extends Controller { ...... public function beforeRender() { parent::beforeRender(); $this->params['referer'] = $this->referer(null, true); } .......... } ```
This commit is contained in:
parent
1709f54e38
commit
7b9ff1c11b
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue