cvs: smarty / Config_File.class.php NEWS
| From: | Monte Ohrt | Date: | Tue, 23 Jul 2002 13:39:59 +0000 |
| Subject: | cvs: smarty / Config_File.class.php NEWS | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-208@lists.php.net to get a copy of this message | ||
mohrt Tue Jul 23 09:39:59 2002 EDT
Modified files:
/smarty Config_File.class.php NEWS
Log:
fix error when there are no sections in config file
Index: smarty/Config_File.class.php
diff -u smarty/Config_File.class.php:1.32 smarty/Config_File.class.php:1.33
--- smarty/Config_File.class.php:1.32 Thu Jul 11 11:18:38 2002
+++ smarty/Config_File.class.php Tue Jul 23 09:39:59 2002
@@ -124,17 +124,23 @@
}
if (!empty($var_name)) {
- if (empty($section_name))
- {
+ if (empty($section_name)) {
return $this->_config_data[$file_name]["vars"][$var_name];
+ } else {
+ if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]))
+ return
$this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
+ else
+ return array();
}
- else
- return
$this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name];
} else {
- if (empty($section_name))
+ if (empty($section_name)) {
return (array)$this->_config_data[$file_name]["vars"];
- else
- return
(array)$this->_config_data[$file_name]["sections"][$section_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"];
+ else
+ return array();
+ }
}
}
Index: smarty/NEWS
diff -u smarty/NEWS:1.221 smarty/NEWS:1.222
--- smarty/NEWS:1.221 Wed Jul 17 17:33:12 2002
+++ smarty/NEWS Tue Jul 23 09:39:59 2002
@@ -1,3 +1,5 @@
+ - fix Config_File class to not error when there are no
+ sections (Peter Kmet, Monte)
- add default modifier logic (Monte)
- updated popup_init to be xhtml compliant (Tom Oram, Monte)
- fix filename bug with windows (Gary Loescher, Monte)