1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Fix bug where absolute paths with dots/double-dots were not collapsed.

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
Edward Z. Yang
2008-08-15 13:12:54 -04:00
parent 8423daef05
commit dc28346677
4 changed files with 18 additions and 8 deletions

View File

@@ -59,6 +59,14 @@ class HTMLPurifier_URIFilter_MakeAbsoluteTest extends HTMLPurifier_URIFilterHarn
$this->assertFiltering('././foo/./bar/.././baz', 'http://example.com/foo/foo/baz');
}
function testFilterAbsolutePathWithDot() {
$this->assertFiltering('/./foo', 'http://example.com/foo');
}
function testFilterAbsolutePathWithMultiDot() {
$this->assertFiltering('/./foo/../bar/.', 'http://example.com/bar/');
}
function testFilterRelativePathWithInternalDotDot() {
$this->assertFiltering('../baz.txt', 'http://example.com/baz.txt');
}