diff --git a/main/Base/Hstore.class.php b/main/Base/Hstore.class.php index 84238beed2..f49440cf3e 100644 --- a/main/Base/Hstore.class.php +++ b/main/Base/Hstore.class.php @@ -85,7 +85,7 @@ public function drop($key) public function isExists($key) { - return isset($this->properties[$key]); + return key_exists($key, $this->properties); } /** diff --git a/test/main/HstoreTest.class.php b/test/main/HstoreTest.class.php index 8938d868a4..3b8226a4fa 100644 --- a/test/main/HstoreTest.class.php +++ b/test/main/HstoreTest.class.php @@ -16,11 +16,15 @@ public function testRun() $array = array( '1' => 'qqer', 'f' => 'qs34$9&)_@+#qer', + 'null' => null ); $test = Hstore::make($array); $test2= Hstore::create($test->toString()); $this->assertEquals($test->toString(), $test2->toString()); + + $this->assertTrue($test->isExists('null')); + $this->assertFalse($test->isExists('notExist')); } }