diff --git a/cis/index.php b/cis/index.php index ee2a23ea5..7c430953e 100644 --- a/cis/index.php +++ b/cis/index.php @@ -59,9 +59,11 @@ if(isset($_GET['sprache'])) { $sprache = new sprache(); if($sprache->load($_GET['sprache'])) + { setSprache($_GET['sprache']); + } else - die('Sprache invalid'); + setSprache(DEFAULT_LANGUAGE); } if(isset($_GET['content_id'])) { diff --git a/include/sprache.class.php b/include/sprache.class.php index 625809c2e..72d3a5ebd 100644 --- a/include/sprache.class.php +++ b/include/sprache.class.php @@ -58,19 +58,27 @@ class sprache extends basis_db { $qry = "SELECT * FROM public.tbl_sprache WHERE sprache=".$this->db_add_param($sprache, FHC_STRING, false).";"; - if(!$this->db_query($qry)) + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->sprache = $row->sprache; + $this->locale = $row->locale; + $this->index = $row->index; + $this->content = $this->db_parse_bool($row->content); + return true; + } + else + { + $this->errormsg = 'Sprache nicht gefunden'; + return false; + } + } + else { $this->errormsg = "Fehler bei der Abfrage."; - return false; + return false; } - if($row = $this->db_fetch_object()) - { - $this->sprache = $row->sprache; - $this->locale = $row->locale; - $this->index = $row->index; - $this->content = $this->db_parse_bool($row->content); - } - return true; } /**