PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_Template_IT » Bug #10050

Touched blocks do not respect removeUnknownVariables

Details

Submitted2007-02-07 23:11 UTC
Frommiroslav dot zacek at symblaze dot cz
Assigneddsp
StatusClosed
PackageHTML_Template_IT
PHP VersionIrrelevant
OSLinux
Roadmaps1.3.0a1

Comments

[2007-02-07 23:11 UTC] miroslav dot zacek at symblaze dot cz

Description:
------------
A touched block with all unset variables will be displayed with variable names (like {XXX}) even though the removeUnknownVariables option is set. The removal is done on line 577 in IT.php but only if at least one variable in the block is set; this is the condition:

if (!$flag_recursion && 0 != count($values)) {
....
//remove empty variables
}

See the code near line 583 of IP.php, the removal of unset variables is missing here if no variable was set in the block ($empty == true):

if ($empty) {
// here the removal is missing
if (!$this->removeEmptyBlocks) {
$this->blockdata[$block ].= $outer;
} else {
if (isset($this->touchedBlocks[$block])) {
$this->blockdata[$block] .= $outer;
unset($this->touchedBlocks[$block]);
}
}
} else {
if (empty($this->blockdata[$block])) {
$this->blockdata[$block] = $outer;
} else {
$this->blockdata[$block] .= $outer;
}
}

[2007-02-12 20:40 UTC] dsp at php dot net

This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.