filterProtocolUrlAttribute() public méthode

Return true if the scheme is authorized.
public filterProtocolUrlAttribute ( string $tag, string $attribute, string $value ) : boolean
$tag string Tag name
$attribute string Attribute name
$value string Attribute value
Résultat boolean
 public function testFilterProtocolAttribute()
 {
     $filter = new Attribute(new Url('http://google.com'));
     $this->assertTrue($filter->filterProtocolUrlAttribute('a', 'href', 'http://google.fr/'));
     $this->assertFalse($filter->filterProtocolUrlAttribute('a', 'href', 'bla://google.fr/'));
     $this->assertFalse($filter->filterProtocolUrlAttribute('a', 'href', 'javascript:alert("test")'));
     $this->assertEquals(array('href' => 'http://google.fr/'), $filter->filter('a', array('href' => 'http://google.fr/')));
     $this->assertEquals(array(), $filter->filter('a', array('href' => 'bla://google.fr/')));
 }