- fixed directory separator handling

This commit is contained in:
Uwe.Tews
2009-05-14 10:53:28 +00:00
parent bd6b49ee1e
commit 1084678645
7 changed files with 544 additions and 540 deletions

View File

@@ -1,3 +1,6 @@
05/14/2009
- fixed directory separator handling
05/09/2009
- syntax change for stream variables
- fixed bug when using absolute template filepath and caching

View File

@@ -449,7 +449,7 @@ class Smarty extends Smarty_Internal_TemplateBase {
}
// loop through plugin dirs and find the plugin
foreach((array)$this->plugins_dir as $_plugin_dir) {
if (substr($_plugin_dir, -1) != DIRECTORY_SEPARATOR) {
if (strpos('/\\',substr($_plugin_dir, -1)) === false) {
$_plugin_dir .= DIRECTORY_SEPARATOR;
}

View File

@@ -165,7 +165,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_Internal_PluginBase {
$_compile_id = '';
}
$_cache_dir = $this->smarty->cache_dir;
if (substr($_cache_dir, -1) != DIRECTORY_SEPARATOR) {
if (strpos('/\\',substr($_cache_dir, -1)) === false) {
$_cache_dir .= DIRECTORY_SEPARATOR;
}

View File

@@ -77,7 +77,7 @@ class Smarty_Internal_Config extends Smarty_Internal_Base {
public function buildConfigFilepath ()
{
foreach((array)$this->smarty->config_dir as $_config_dir) {
if (substr($_config_dir, -1) != DIRECTORY_SEPARATOR) {
if (strpos('/\\',substr($_config_dir, -1)) === false) {
$_config_dir .= DIRECTORY_SEPARATOR;
}

View File

@@ -111,7 +111,7 @@ class Smarty_Internal_Resource_File extends Smarty_Internal_Base {
$_cache = '';
}
$_compile_dir = $_template->smarty->compile_dir;
if (substr($_compile_dir, -1) != DIRECTORY_SEPARATOR) {
if (strpos('/\\',substr($_compile_dir, -1)) === false) {
$_compile_dir .= DIRECTORY_SEPARATOR;
}
return $_compile_dir . $_filepath . '.' . basename($_template->resource_name) . $_cache . $_template->smarty->php_ext;

View File

@@ -591,7 +591,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase {
$file = $this->resource_name;
}
foreach((array)$this->smarty->template_dir as $_template_dir) {
if (substr($_template_dir, -1) != DIRECTORY_SEPARATOR) {
if (strpos('/\\',substr($_template_dir, -1)) === false) {
$_template_dir .= DIRECTORY_SEPARATOR;
}

File diff suppressed because it is too large Load Diff