/** * @param array $options * * Options accepted in addition to those provided by Text: * * - shortcodes: If true, shortcodes will be turned into the appropriate HTML. * If false, shortcodes will not be processed. * * - whitelist: If provided, a comma-separated list of elements that will be allowed to be stored * (be careful on relying on this for XSS protection - some seemingly-safe elements allow * attributes that can be exploited, for instance <img onload="exploiting_code();" src="..." />) * Text nodes outside of HTML tags are filtered out by default, but may be included by adding * the text() directive. E.g. 'link,meta,text()' will allow only <link /> <meta /> and text at * the root level. * * @return $this */ public function setOptions(array $options = array()) { if (array_key_exists("shortcodes", $options)) { $this->setProcessShortcodes(!!$options["shortcodes"]); } return parent::setOptions($options); }
public function __construct($name = null, $size = 16) { parent::__construct($name, $size); }
public function testExists() { $varcharField = new DBVarchar("testfield"); $this->assertTrue($varcharField->getNullifyEmpty()); $varcharField->setValue('abc'); $this->assertTrue($varcharField->exists()); $varcharField->setValue(''); $this->assertFalse($varcharField->exists()); $varcharField->setValue(null); $this->assertFalse($varcharField->exists()); $varcharField = new DBVarchar("testfield", 50, array('nullifyEmpty' => false)); $this->assertFalse($varcharField->getNullifyEmpty()); $varcharField->setValue('abc'); $this->assertTrue($varcharField->exists()); $varcharField->setValue(''); $this->assertTrue($varcharField->exists()); $varcharField->setValue(null); $this->assertFalse($varcharField->exists()); $textField = new DBText("testfield"); $this->assertTrue($textField->getNullifyEmpty()); $textField->setValue('abc'); $this->assertTrue($textField->exists()); $textField->setValue(''); $this->assertFalse($textField->exists()); $textField->setValue(null); $this->assertFalse($textField->exists()); $textField = new DBText("testfield", array('nullifyEmpty' => false)); $this->assertFalse($textField->getNullifyEmpty()); $textField->setValue('abc'); $this->assertTrue($textField->exists()); $textField->setValue(''); $this->assertTrue($textField->exists()); $textField->setValue(null); $this->assertFalse($textField->exists()); }