Project

General

Profile

Bug #24224 » 16593_test_44.patch

Administrator Admin, 2010-12-09 22:48

View differences:

tests/t3lib/t3lib_divTest.php (Arbeitskopie)
t3lib_div::makeInstance($className)
);
}
/**
* Data provider for validPathStrDetectsInvalidCharacters.
*
* @return array
*/
public function validPathStrInvalidCharactersDataProvider() {
return array(
'double slash in path' => array('path//path'),
'backslash in path' => array('path\\path'),
'directory up in path' => array('path/../path'),
'directory up at the beginning' => array('../path'),
'NUL character in path' => array("path\x00path"),
'BS character in path' => array("path\x08path"),
);
}
/**
* Tests whether invalid characters are detected.
*
* @param string $path
* @dataProvider validPathStrInvalidCharactersDataProvider
* @test
*/
public function validPathStrDetectsInvalidCharacters($path) {
$this->assertNull(t3lib_div::validPathStr($path));
}
/**
* Tests whether verifyFilenameAgainstDenyPattern detects the null character.
*
* @test
*/
public function verifyFilenameAgainstDenyPatternDetectsNullCharacter() {
$this->assertFalse(t3lib_div::verifyFilenameAgainstDenyPattern("image\x00.gif"));
}
}
?>
(7-7/8)