Example #1
0
 /**
  * {@inheritdoc}
  */
 public function asConfig()
 {
     if (!isset($this->vars['regexp'])) {
         throw new RuntimeException("Regexp filter is missing a 'regexp' value");
     }
     return parent::asConfig();
 }
Example #2
0
 /**
  * Constructor
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct('s9e\\TextFormatter\\Parser\\BuiltInFilters::filterUrl');
     $this->resetParameters();
     $this->addParameterByName('attrValue');
     $this->addParameterByName('urlConfig');
     $this->addParameterByName('logger');
     $this->setJS('BuiltInFilters.filterUrl');
 }
Example #3
0
 public function asConfig()
 {
     if (!isset($this->vars['min'])) {
         throw new RuntimeException("Range filter is missing a 'min' value");
     }
     if (!isset($this->vars['max'])) {
         throw new RuntimeException("Range filter is missing a 'max' value");
     }
     return parent::asConfig();
 }
Example #4
0
 public function __construct()
 {
     parent::__construct('s9e\\TextFormatter\\Parser\\BuiltInFilters::filterSimpletext');
     $this->setJS('BuiltInFilters.filterSimpletext');
 }
 /**
  * @testdox getParser() removes JavaScript-specific data from attribute filters
  */
 public function testAsConfigRemovesJavaScriptAttributeFilters()
 {
     $filter = new AttributeFilter(function ($v) {
     });
     $filter->setJS('function(v){return false;}');
     $this->configurator->tags->add('A')->attributes->add('a')->filterChain->append($filter);
     $parser = $this->configurator->getParser();
     $tagsConfig = $this->readAttribute($parser, 'tagsConfig');
     $this->assertArrayNotHasKey('js', $tagsConfig['A']['attributes']['a']['filterChain'][0]);
 }
 /**
  * @testdox isSafeAsURL() returns TRUE if markAsSafeAsURL() is called
  */
 public function testMarkedSafeAsURL()
 {
     $filter = new AttributeFilter(function () {
     });
     $filter->markAsSafeAsURL();
     $this->assertTrue($filter->isSafeAsURL());
 }