mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
fixed a few warning messages
This commit is contained in:
@@ -118,8 +118,11 @@ class Smarty
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function Smarty()
|
function Smarty()
|
||||||
{
|
{
|
||||||
foreach ($this->global_assign as $var_name)
|
foreach ($this->global_assign as $var_name) {
|
||||||
$this->assign($var_name, $GLOBALS[$var_name]);
|
if(isset($GLOBALS[$var_name])) {
|
||||||
|
$this->assign($var_name, $GLOBALS[$var_name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -376,10 +379,11 @@ class Smarty
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($display) {
|
if ($display) {
|
||||||
echo $results;
|
if(isset($results)) { echo $results; }
|
||||||
return;
|
return;
|
||||||
} else
|
} else {
|
||||||
return $results;
|
if(isset($results)) { return $results; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================*\
|
/*======================================================================*\
|
||||||
@@ -1140,7 +1144,7 @@ class Smarty
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _parse_vars_props(&$tokens)
|
function _parse_vars_props(&$tokens)
|
||||||
{
|
{
|
||||||
$qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
|
$qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
|
||||||
|
|
||||||
/* preg_grep() was fixed to return keys properly in 4.0.4 and later. To
|
/* 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);
|
$sections = explode('/', $var_ref);
|
||||||
$props = explode('.', array_pop($sections));
|
$props = explode('.', array_pop($sections));
|
||||||
$var_name = array_shift($props);
|
$var_name = array_shift($props);
|
||||||
|
|
||||||
$output = "\$$var_name";
|
$output = "\$$var_name";
|
||||||
|
|
||||||
foreach ($sections as $section_ref) {
|
foreach ($sections as $section_ref) {
|
||||||
|
@@ -118,8 +118,11 @@ class Smarty
|
|||||||
\*======================================================================*/
|
\*======================================================================*/
|
||||||
function Smarty()
|
function Smarty()
|
||||||
{
|
{
|
||||||
foreach ($this->global_assign as $var_name)
|
foreach ($this->global_assign as $var_name) {
|
||||||
$this->assign($var_name, $GLOBALS[$var_name]);
|
if(isset($GLOBALS[$var_name])) {
|
||||||
|
$this->assign($var_name, $GLOBALS[$var_name]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -376,10 +379,11 @@ class Smarty
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($display) {
|
if ($display) {
|
||||||
echo $results;
|
if(isset($results)) { echo $results; }
|
||||||
return;
|
return;
|
||||||
} else
|
} else {
|
||||||
return $results;
|
if(isset($results)) { return $results; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*======================================================================*\
|
/*======================================================================*\
|
||||||
@@ -1140,7 +1144,7 @@ class Smarty
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _parse_vars_props(&$tokens)
|
function _parse_vars_props(&$tokens)
|
||||||
{
|
{
|
||||||
$qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
|
$qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"|\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'';
|
||||||
|
|
||||||
/* preg_grep() was fixed to return keys properly in 4.0.4 and later. To
|
/* 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);
|
$sections = explode('/', $var_ref);
|
||||||
$props = explode('.', array_pop($sections));
|
$props = explode('.', array_pop($sections));
|
||||||
$var_name = array_shift($props);
|
$var_name = array_shift($props);
|
||||||
|
|
||||||
$output = "\$$var_name";
|
$output = "\$$var_name";
|
||||||
|
|
||||||
foreach ($sections as $section_ref) {
|
foreach ($sections as $section_ref) {
|
||||||
|
Reference in New Issue
Block a user