Fix CSS URL innerHTML/cssText escaping bug.
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / CSS / URITest.php
blob3d6f5791ef888b22e77a333c2f164d21313959f5
1 <?php
3 class HTMLPurifier_AttrDef_CSS_URITest extends HTMLPurifier_AttrDefHarness
6 function test() {
8 $this->def = new HTMLPurifier_AttrDef_CSS_URI();
10 $this->assertDef('', false);
12 // we could be nice but we won't be
13 $this->assertDef('http://www.example.com/', false);
15 $this->assertDef('url(', false);
16 $this->assertDef('url("")', true);
17 $result = 'url("http://www.example.com/")';
18 $this->assertDef('url(http://www.example.com/)', $result);
19 $this->assertDef('url("http://www.example.com/")', $result);
20 $this->assertDef("url('http://www.example.com/')", $result);
21 $this->assertDef(
22 ' url( "http://www.example.com/" ) ', $result);
23 $this->assertDef("url(http://www.example.com/foo,bar\)\'\()",
24 'url("http://www.example.com/foo,bar%29%27%28")');
29 // vim: et sw=4 sts=4