Skip to content
Permalink
Browse files

Updated test

  • Loading branch information...
davidsteinsland committed Feb 19, 2015
1 parent 960ddd0 commit 463fa660bc26fad8e15e0f8bc11355dbc1520500
Showing with 5 additions and 16 deletions.
  1. +5 −16 lib/Cake/Test/Case/Network/CakeResponseTest.php
@@ -1179,27 +1179,16 @@ public function testFileWithPathTraversal() {
}
/**
* Although unlikely, file's may contain dots in their filenames.
* Although unlikely, a file may contain dots in its filename.
* This should be allowed, as long as the dots doesn't specify a path (../ or ..\)
*
* @expectedException NotFoundException
* @execptedExceptionMessageRegExp #The requested file .+my/Some..cat.gif was not found or not readable#
* @return void
*/
public function testFileWithDotsInFilename() {
$ok = false;
$file = 'my/Some..cat.gif';
try {
$response = new CakeResponse();
$response->file($file);
} catch (NotFoundException $e) {
if (Configure::read('debug') > 0) {
$ok = $e->getMessage() === sprintf('The requested file %s was not found or not readable', APP . $file);
} else {
$ok = $e->getMessage() === 'The requested file was not found';
}
}
$this->assertTrue($ok);
$response = new CakeResponse();
$response->file('my/Some..cat.gif');
}
/**

0 comments on commit 463fa66

Please sign in to comment.
You can’t perform that action at this time.