PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_Template_Sigma » Bug #6902

Problem w/ cache filename on Windows

Details

Submitted2006-02-23 10:40 UTC
Fromslaurencot at sqli dot com
Assignedavb
StatusClosed
PackageHTML_Template_Sigma
PHP Version4.3.11
OSWinXP
Roadmaps(Not assigned)

Comments

[2006-02-23 10:40 UTC] slaurencot at sqli dot com

Description:
------------
The cache filename returned by _cachedName() isn't correct on Windows if using absolute path.

Ex. if I have 2 templates, "c:/template/tmp1.tpl" and "c:/template/tmp2.tpl", _cachedName() will return "c" as cachedName 2 times.

Test script:
---------------
A solution is to remove ":" in $filename :

function _cachedName($filename)
{
if ('/' == $filename{0} && '/' == substr($this->_cacheRoot, -1)) {
$filename = substr($filename, 1);
}
$filename = str_replace('/', '__', $filename);

// The str_replace below correct the problem
$filename = str_replace(':', '', $filename);

return $this->_cacheRoot. $filename. '.it';
} // _cachedName