aboutsummaryrefslogtreecommitdiff
path: root/bin/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'bin/index.php')
-rwxr-xr-xbin/index.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/index.php b/bin/index.php
index c6de5a9..374923c 100755
--- a/bin/index.php
+++ b/bin/index.php
@@ -182,12 +182,10 @@ if ($arXpdates->length) {
//language
//there may be "en-US" and "de-DE"
-$indexDoc->language = strtolower(
- substr(
- $doc->documentElement->attributes->getNamedItem('lang')->textContent,
- 0, 2
- )
-);
+$xlang = $doc->documentElement->attributes->getNamedItem('lang');
+if ($xlang) {
+ $indexDoc->language = strtolower(substr($xlang->textContent, 0, 2));
+}
//FIXME: fallback, autodetection
//FIXME: check noindex