[geeklog-cvs] geeklog: Check if variables are set before using them

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Feb 7 09:59:40 EST 2009


details:   http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f3c8c971e6b6
changeset: 6763:f3c8c971e6b6
user:      Dirk Haun <dirk at haun-online.de>
date:      Sat Feb 07 15:20:13 2009 +0100
description:
Check if variables are set before using them

diffstat:

1 file changed, 11 insertions(+), 3 deletions(-)
system/classes/config.class.php |   14 +++++++++++---

diffs (28 lines):

diff -r f2c9ffac0fbc -r f3c8c971e6b6 system/classes/config.class.php
--- a/system/classes/config.class.php	Wed Feb 04 13:48:07 2009 +0100
+++ b/system/classes/config.class.php	Sat Feb 07 15:20:13 2009 +0100
@@ -373,13 +373,21 @@
         global $_USER;
 
         if (empty($_USER['theme'])) {
-            $theme = $this->config_array['Core']['theme'];
+            if (! empty($this->config_array['Core']['theme'])) {
+                $theme = $this->config_array['Core']['theme'];
+            }
         } else {
             $theme = $_USER['theme'];
         }
 
-        $this->config_array['Core']['path_layout'] = $this->config_array['Core']['path_themes'] . $theme . '/';
-        $this->config_array['Core']['layout_url'] = $this->config_array['Core']['site_url'] . '/layout/' . $theme;
+        if (! empty($theme)) {
+            if (! empty($this->config_array['Core']['path_themes'])) {
+                $this->config_array['Core']['path_layout'] = $this->config_array['Core']['path_themes'] . $theme . '/';
+            }
+            if (! empty($this->config_array['Core']['site_url'])) {
+                $this->config_array['Core']['layout_url'] = $this->config_array['Core']['site_url'] . '/layout/' . $theme;
+            }
+        }
     }
 
     function _get_groups()



More information about the geeklog-cvs mailing list