mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
Update for {fetch} plugin
This commit is contained in:
@@ -51,17 +51,18 @@ class PluginFunctionFetchTest extends PHPUnit_Smarty
|
||||
}
|
||||
|
||||
/**
|
||||
* test {fetch file=...} access to file from path not aloowed by security settings
|
||||
* test {fetch file=...} access to file from path not aloo/wed by security settings
|
||||
*
|
||||
* @expectedException SmartyException
|
||||
* @expectedExceptionMessage not allowed by security setting
|
||||
* @expectedExceptionMessage not trusted file pat
|
||||
* @run InSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testFetchSecurity()
|
||||
{
|
||||
$this->cleanDirs();
|
||||
$dir=$this->smarty->getTemplateDir();
|
||||
$this->smarty->enableSecurity();
|
||||
$result = $this->smarty->fetch('string:{fetch file=\''. $dir[0]. '..\..\..\..\..\etc\passwd\'}');
|
||||
$result = $this->smarty->fetch('string:{fetch file=\''. $dir[0]. '../../../../../etc/passwd\'}');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user