Commit 7869a71a by Seldaek

+ Added a test for auto escape used in params

git-svn-id: svn://dwoo.org/dwoo/trunk@120 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent c2680477
......@@ -505,6 +505,18 @@ replace="BAR"
$this->assertEquals("a&lt;b&gt;ca<b>c", $this->dwoo->get($tpl, array('foo'=>'a<b>c'), $cmp));
}
public function testAutoEscapeWithFunctionCall()
{
$cmp = new Dwoo_Compiler();
$cmp->setAutoEscape(true);
$this->assertEquals(true, $cmp->getAutoEscape());
$tpl = new Dwoo_Template_String('{upper $foo}{upper $foo|safe}');
$tpl->forceCompilation();
$this->assertEquals("A&LT;B&GT;CA<B>C", $this->dwoo->get($tpl, array('foo'=>'a<b>c'), $cmp));
}
public function testPhpInjection()
{
$tpl = new Dwoo_Template_String('{$foo}');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment