/** * test entities */ public function testHtmlentities() { // normal $this->assertEquals(CCStr::htmlentities('<test>'), '<test>'); // array $this->assertEquals(CCStr::htmlentities(array('<test>', '<test2>')), array('<test>', '<test2>')); // multi dimensional array $this->assertEquals(CCStr::htmlentities(array('<test>', 'test' => array('<test3>')), true), array('<test>', 'test' => array('<test3>'))); }
function _e($in, $recursive = false) { return CCStr::htmlentities($in, $recursive = false); }
/** * custom setter with encode ability * * @param string $key * @param mixed $value * @param mixed $param * @return void */ public function set($key, $value, $param = null) { if ($param === true) { $value = CCStr::htmlentities($value); } return CCArr::set($key, $value, $this->_data); }