From d238d8c0bbf51580bdb5dbd86c912c5b85bdbe0d Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 9 Jan 2012 21:47:57 -0500 Subject: [PATCH] Fix incorrect `__isset()`. There was a missing $ before name. Fixes issues with dynamic properties not being handled correctly. Fixes #2450 --- lib/Cake/Test/Case/View/ViewTest.php | 12 ++++++++++++ lib/Cake/View/View.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index 227c12454..67f68ca57 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -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); + } } diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index 0e8b04b31..61eca340b 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -796,7 +796,7 @@ class View extends Object { * @return boolean */ public function __isset($name) { - return isset($this->name); + return isset($this->{$name}); } /**