diff options
| author | Uwe.Tews <uwe.tews@localhost> | 2010-08-23 14:40:10 +0000 |
|---|---|---|
| committer | Uwe.Tews <uwe.tews@localhost> | 2010-08-23 14:40:10 +0000 |
| commit | 96e3d9937ab46d2397575efab3506382a2fe82f6 (patch) | |
| tree | 865c7945f8c93f0a31c656b1808fdde7d4277280 /libs | |
| parent | ee15e5354250f8ff2e28d9331b9b21bf6a6be95e (diff) | |
| download | smarty-96e3d9937ab46d2397575efab3506382a2fe82f6.tar.gz smarty-96e3d9937ab46d2397575efab3506382a2fe82f6.tar.bz2 smarty-96e3d9937ab46d2397575efab3506382a2fe82f6.zip | |
- fixed E_STRICT errors for uninitialized variables
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/plugins/function.html_table.php | 1 | ||||
| -rw-r--r-- | libs/plugins/function.math.php | 2 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_extends.php | 2 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_include.php | 3 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_insert.php | 2 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_config.php | 1 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_data.php | 2 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_template.php | 8 |
8 files changed, 15 insertions, 6 deletions
diff --git a/libs/plugins/function.html_table.php b/libs/plugins/function.html_table.php index 83e80300..f279ad6d 100644 --- a/libs/plugins/function.html_table.php +++ b/libs/plugins/function.html_table.php @@ -61,6 +61,7 @@ function smarty_function_html_table($params, $smarty, $template) $hdir = 'right'; $inner = 'cols'; $caption = ''; + $loop = null; if (!isset($params['loop'])) { trigger_error("html_table: missing 'loop' parameter",E_USER_WARNING); diff --git a/libs/plugins/function.math.php b/libs/plugins/function.math.php index edeef5af..197f4df1 100644 --- a/libs/plugins/function.math.php +++ b/libs/plugins/function.math.php @@ -63,7 +63,7 @@ function smarty_function_math($params, $smarty, $template) $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); } } - + $smarty_math_result = null; eval("\$smarty_math_result = ".$equation.";"); if (empty($params['format'])) { diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index 4075a962..b8196bd1 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -31,7 +31,7 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase { // check and get attributes $_attr = $this->_get_attributes($args); $_smarty_tpl = $compiler->template; - // $include_file = ''; + $include_file = null; eval('$include_file = ' . $_attr['file'] . ';'); // create template object $_template = new $compiler->smarty->template_class($include_file, $this->smarty, $compiler->template); diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index 7f0fee28..4c5d3f01 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -34,7 +34,8 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase { if ($compiler->smarty->merge_compiled_includes || isset($_attr['inline'])) { // check if compiled code can be merged (contains no variable part) if (!$compiler->has_variable_string && (substr_count($include_file, '"') == 2 or substr_count($include_file, "'") == 2) and substr_count($include_file, '(') == 0) { - eval("\$tmp = $include_file;"); + $tmp = null; + eval("\$tmp = $include_file;"); if ($this->compiler->template->template_resource != $tmp) { $tpl = $compiler->smarty->createTemplate ($tmp, $compiler->template->cache_id, $compiler->template->compile_id, $compiler->template); if ($this->compiler->template->caching) { diff --git a/libs/sysplugins/smarty_internal_compile_insert.php b/libs/sysplugins/smarty_internal_compile_insert.php index 94c9b3aa..f1b5e8eb 100644 --- a/libs/sysplugins/smarty_internal_compile_insert.php +++ b/libs/sysplugins/smarty_internal_compile_insert.php @@ -32,6 +32,8 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase { $this->compiler->suppressNocacheProcessing = true; $this->compiler->tag_nocache = true; $_smarty_tpl = $compiler->template; + $_name = null; + $_script = null; $_output = '<?php '; // save posible attributes diff --git a/libs/sysplugins/smarty_internal_config.php b/libs/sysplugins/smarty_internal_config.php index a74270fa..5097398c 100644 --- a/libs/sysplugins/smarty_internal_config.php +++ b/libs/sysplugins/smarty_internal_config.php @@ -243,6 +243,7 @@ class Smarty_Internal_Config { if ($this->mustCompile()) { $this->compileConfigSource(); } + $_config_vars = array(); include($this->getCompiledFilepath ()); // copy global config vars foreach ($_config_vars['vars'] as $variable => $value) { diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php index 8c35f83f..95a03c77 100644 --- a/libs/sysplugins/smarty_internal_data.php +++ b/libs/sysplugins/smarty_internal_data.php @@ -332,7 +332,7 @@ class Smarty_Internal_Data { return $_result; } - if ($this->smarty->$error_unassigned) { + if ($this->smarty->error_unassigned) { throw new SmartyException('Undefined stream variable "' . $variable . '"'); } else { return ''; diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index bda99e58..9f91ac6d 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -375,11 +375,13 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { } $this->cacheFileChecked = true; if ($this->caching === SMARTY_CACHING_LIFETIME_SAVED && $this->properties['cache_lifetime'] >= 0 && (time() > ($this->getCachedTimestamp() + $this->properties['cache_lifetime']))) { - $this->tpl_vars = array(); - $this->rendered_content = null; + $this->tpl_vars = array(); + $this->rendered_content = null; return $this->isCached; } if (!empty($this->properties['file_dependency']) && $this->smarty->compile_check) { + $resource_type = null; + $resource_name = null; foreach ($this->properties['file_dependency'] as $_file_to_check) { $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name); If ($resource_type == 'file') { @@ -429,6 +431,8 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { if ($this->smarty->compile_check) { if (!empty($this->properties['file_dependency'])) { $this->mustCompile = false; + $resource_type = null; + $resource_name = null; foreach ($this->properties['file_dependency'] as $_file_to_check) { $this->getResourceTypeName($_file_to_check[0], $resource_type, $resource_name); If ($resource_type == 'file') { |
