mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 23:49:55 +00:00
Fix incorrect __isset()
.
There was a missing $ before name. Fixes issues with dynamic properties not being handled correctly. Fixes #2450
This commit is contained in:
parent
b8598c5ca0
commit
d238d8c0bb
2 changed files with 13 additions and 1 deletions
|
@ -1236,4 +1236,16 @@ Element content.
|
||||||
TEXT;
|
TEXT;
|
||||||
$this->assertEquals($expected, $content);
|
$this->assertEquals($expected, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that setting arbitrary properties still works.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testPropertySetting() {
|
||||||
|
$this->assertFalse(isset($this->View->pageTitle));
|
||||||
|
$this->View->pageTitle = 'test';
|
||||||
|
$this->assertTrue(isset($this->View->pageTitle));
|
||||||
|
$this->assertEquals('test', $this->View->pageTitle);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -796,7 +796,7 @@ class View extends Object {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function __isset($name) {
|
public function __isset($name) {
|
||||||
return isset($this->name);
|
return isset($this->{$name});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue