aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib.php b/lib.php
index bde2ee9..28b72cf 100644
--- a/lib.php
+++ b/lib.php
@@ -110,10 +110,8 @@ function _mgnav_style()
*/
function _lang_check($s = null)
{
- if (!is_null($s)) {
- $sub = explode('-', $s);
- $sub = strtolower($sub[0]);
- }
+ if (is_null($s))
+ return 'en';
$supported = array(
'cs',
@@ -134,8 +132,11 @@ function _lang_check($s = null)
if (in_array($s, $supported))
return $s;
+ $sub = explode('-', $s);
+ $sub = strtolower($sub[0]);
+
if (in_array($sub, $supported))
- return $s;
+ return $sub;
return 'en';
}