From 31a10c5d9a425b5f0f7c86d9cc39bf42364f68b1 Mon Sep 17 00:00:00 2001 From: mohrt Date: Fri, 2 Mar 2001 18:07:51 +0000 Subject: [PATCH] fixed a few warning messages --- Smarty.class.php | 18 +++++++++++------- libs/Smarty.class.php | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index f5f0d5c0..6e1f6f2d 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -118,8 +118,11 @@ class Smarty \*======================================================================*/ function Smarty() { - foreach ($this->global_assign as $var_name) - $this->assign($var_name, $GLOBALS[$var_name]); + foreach ($this->global_assign as $var_name) { + if(isset($GLOBALS[$var_name])) { + $this->assign($var_name, $GLOBALS[$var_name]); + } + } } @@ -376,10 +379,11 @@ class Smarty } if ($display) { - echo $results; + if(isset($results)) { echo $results; } return; - } else - return $results; + } else { + if(isset($results)) { return $results; } + } } /*======================================================================*\ @@ -1140,7 +1144,7 @@ class Smarty } function _parse_vars_props(&$tokens) - { + { $qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\''; /* preg_grep() was fixed to return keys properly in 4.0.4 and later. To @@ -1182,7 +1186,7 @@ class Smarty $sections = explode('/', $var_ref); $props = explode('.', array_pop($sections)); $var_name = array_shift($props); - + $output = "\$$var_name"; foreach ($sections as $section_ref) { diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index f5f0d5c0..6e1f6f2d 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -118,8 +118,11 @@ class Smarty \*======================================================================*/ function Smarty() { - foreach ($this->global_assign as $var_name) - $this->assign($var_name, $GLOBALS[$var_name]); + foreach ($this->global_assign as $var_name) { + if(isset($GLOBALS[$var_name])) { + $this->assign($var_name, $GLOBALS[$var_name]); + } + } } @@ -376,10 +379,11 @@ class Smarty } if ($display) { - echo $results; + if(isset($results)) { echo $results; } return; - } else - return $results; + } else { + if(isset($results)) { return $results; } + } } /*======================================================================*\ @@ -1140,7 +1144,7 @@ class Smarty } function _parse_vars_props(&$tokens) - { + { $qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\''; /* preg_grep() was fixed to return keys properly in 4.0.4 and later. To @@ -1182,7 +1186,7 @@ class Smarty $sections = explode('/', $var_ref); $props = explode('.', array_pop($sections)); $var_name = array_shift($props); - + $output = "\$$var_name"; foreach ($sections as $section_ref) {