summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--php/ws-procedures.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/php/ws-procedures.php b/php/ws-procedures.php
index 9a0fce4..fa772d2 100644
--- a/php/ws-procedures.php
+++ b/php/ws-procedures.php
@@ -4,7 +4,11 @@ $wsdata = file($dpath.'/'.$common, FILE_IGNORE_NEW_LINES);
 
 # Language overwritten by the browser preference
 if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
-  $wsdata[4] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0,2);
+{
+  $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0,2);
+  if(file_exists($dpath.$lang))
+    $wsdata[4] = $lang;
+}
 
 $wsdata = array_merge($wsdata, file($dpath.$wsdata[4].'/'.$common, FILE_IGNORE_NEW_LINES));
 ?>