Skip to content

Commit d2f2cfc

Browse files
committed
Fix serendipity_detectLang error when no lang is set
Happens in a test environment
1 parent dad57b0 commit d2f2cfc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/compat.inc.php

+3
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ function serendipity_getCharset() {
396396
function serendipity_detectLang($use_include = false) {
397397
global $serendipity;
398398

399+
if ($serendipity['languages'] == null) {
400+
return null;
401+
}
399402
$supported_languages = array_keys($serendipity['languages']);
400403
$possible_languages = explode(',', (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''));
401404
if (is_array($possible_languages)) {

include/functions_smarty.inc.php

-1
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,6 @@ function serendipity_smarty_init($vars = array()) {
980980
// Beware: Smarty is used in the Admin backend, despite of this.
981981
include_once $template_dir . '/template.inc.php';
982982
} else {
983-
984983
// Backend template overwritten here (NOT earlier due to frontend specific check)
985984
if (defined('IN_serendipity_admin')) {
986985
$template_dir = $serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['template_backend'];

0 commit comments

Comments
 (0)