2007-01-14 15:54:05 +00:00
|
|
|
<?php
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
class HTMLPurifier_AttrDef_CSS_URITest extends HTMLPurifier_AttrDefHarness
|
2007-01-14 15:54:05 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-01-14 15:54:05 +00:00
|
|
|
function test() {
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
$this->def = new HTMLPurifier_AttrDef_CSS_URI();
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-01-14 15:54:05 +00:00
|
|
|
$this->assertDef('', false);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-01-14 15:54:05 +00:00
|
|
|
// we could be nice but we won't be
|
|
|
|
$this->assertDef('http://www.example.com/', false);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-01-14 15:54:05 +00:00
|
|
|
$this->assertDef('url(', false);
|
2010-05-21 15:53:52 +00:00
|
|
|
$this->assertDef('url("")', true);
|
|
|
|
$result = 'url("http://www.example.com/")';
|
2007-01-14 15:54:05 +00:00
|
|
|
$this->assertDef('url(http://www.example.com/)', $result);
|
|
|
|
$this->assertDef('url("http://www.example.com/")', $result);
|
|
|
|
$this->assertDef("url('http://www.example.com/')", $result);
|
|
|
|
$this->assertDef(
|
|
|
|
' url( "http://www.example.com/" ) ', $result);
|
2008-12-06 07:28:20 +00:00
|
|
|
$this->assertDef("url(http://www.example.com/foo,bar\))",
|
2010-05-21 15:53:52 +00:00
|
|
|
'url("http://www.example.com/foo,bar)")');
|
2007-01-14 15:54:05 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-01-14 15:54:05 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|