mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
fix error when there are no sections in config file
This commit is contained in:
@@ -124,17 +124,23 @@ class Config_File {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($var_name)) {
|
if (!empty($var_name)) {
|
||||||
if (empty($section_name))
|
if (empty($section_name)) {
|
||||||
{
|
|
||||||
return $this->_config_data[$file_name]["vars"][$var_name];
|
return $this->_config_data[$file_name]["vars"][$var_name];
|
||||||
}
|
|
||||||
else
|
|
||||||
return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
|
|
||||||
} else {
|
} else {
|
||||||
if (empty($section_name))
|
if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
|
||||||
return (array)$this->_config_data[$file_name]["vars"];
|
return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
|
||||||
else
|
else
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (empty($section_name)) {
|
||||||
|
return (array)$this->_config_data[$file_name]["vars"];
|
||||||
|
} else {
|
||||||
|
if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
|
||||||
return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
|
return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
|
||||||
|
else
|
||||||
|
return array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
NEWS
2
NEWS
@@ -1,3 +1,5 @@
|
|||||||
|
- fix Config_File class to not error when there are no
|
||||||
|
sections (Peter Kmet, Monte)
|
||||||
- add default modifier logic (Monte)
|
- add default modifier logic (Monte)
|
||||||
- updated popup_init to be xhtml compliant (Tom Oram, Monte)
|
- updated popup_init to be xhtml compliant (Tom Oram, Monte)
|
||||||
- fix filename bug with windows (Gary Loescher, Monte)
|
- fix filename bug with windows (Gary Loescher, Monte)
|
||||||
|
@@ -124,17 +124,23 @@ class Config_File {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($var_name)) {
|
if (!empty($var_name)) {
|
||||||
if (empty($section_name))
|
if (empty($section_name)) {
|
||||||
{
|
|
||||||
return $this->_config_data[$file_name]["vars"][$var_name];
|
return $this->_config_data[$file_name]["vars"][$var_name];
|
||||||
}
|
|
||||||
else
|
|
||||||
return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
|
|
||||||
} else {
|
} else {
|
||||||
if (empty($section_name))
|
if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
|
||||||
return (array)$this->_config_data[$file_name]["vars"];
|
return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
|
||||||
else
|
else
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (empty($section_name)) {
|
||||||
|
return (array)$this->_config_data[$file_name]["vars"];
|
||||||
|
} else {
|
||||||
|
if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"]))
|
||||||
return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
|
return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"];
|
||||||
|
else
|
||||||
|
return array();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user