mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +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;
|
||||
$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
|
||||
*/
|
||||
public function __isset($name) {
|
||||
return isset($this->name);
|
||||
return isset($this->{$name});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue