Commit 3908610b by Seldaek

* Fixed a block stack bug that messed up {textformat} and possibly usermade block plugins

git-svn-id: svn://dwoo.org/dwoo/trunk@72 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent da2f8fa1
[2008--] 0.9.1
+ API: Added Dwoo_Compiler->setAutoEscape() and getAutoEscape() to modify the
automatic html entity escaping setting. This is disabled by default, and when
enabled can be overriden with the {safe $var} plugin or the
{auto_escape disable} block plugin. The block plugin can also be used to
enabled can be overriden with the {safe $var} plugin or the
{auto_escape disable} block plugin. The block plugin can also be used to
enable this mode from within a template
+ Syntax: Mixing named and unnamed parameters is now allowed, as long as the
unnamed ones appear first
......@@ -14,6 +14,8 @@
* Fixed complex variables (i.e. {$_root[$c[$x.0]].0}) parsing bugs
* Fixed $dwoo->addResource() breaking if the resource class was not loaded yet,
autoload should now be called (thanks mike)
* Fixed a block stack bug that messed up {textformat} and possibly usermade
block plugins
[2008-05-10] 0.9.0
! BC Break: changed all class names to be PEAR compliant (aka use underscores
......
......@@ -925,6 +925,7 @@ class Dwoo
}
else
{
$this->curBlock = null;
echo $tmp->process();
}
......
<?php
require_once 'Dwoo/Compiler.php';
class BugTests extends PHPUnit_Framework_TestCase
{
protected $compiler;
protected $dwoo;
public function __construct()
{
$this->compiler = new Dwoo_Compiler();
$this->dwoo = new Dwoo();
}
public function testBlockStackBufferingBug()
{
$tpl = new Dwoo_Template_String('{textformat 10 wrap_char="\n"}here is some text that should wrap{/textformat}
{textformat 10 wrap_cut=true wrap_char="\n"}and this one should cut words that go beyooooooond 10 chars{/textformat}');
$tpl->forceCompilation();
$this->assertEquals("here is\nsome text\nthat\nshould\nwrap\nand this\none should\ncut words\nthat go\nbeyooooooo\nnd 10\nchars", $this->dwoo->get($tpl, array()));
}
}
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