Skip to content

Commit

Permalink
Fixed issue : #6319 Previewgroup can throw error
Browse files Browse the repository at this point in the history
Dev: fixed issue : set $_SESSION['s_lang'] according to existing survey langage (if unique)
Dev : before if $langage!= survey['default_langage'] and non other langage, then $_SESSION['s_lang'] is not set
  • Loading branch information
Shnoulle committed Aug 10, 2012
1 parent 781a7d3 commit f6ac394
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions common_functions.php
Expand Up @@ -3051,15 +3051,17 @@ function SetSurveyLanguage($surveyid, $language)
$default_language = $row['language'];
}

if (!isset($language) || ($language=='') || (isset($additional_languages) && strpos($additional_languages, $language) === false)
or (isset($default_language) && $default_language == $language)
) {
// Language not supported, or default language for survey, fall back to survey's default language
if (!isset($language) || ($language=='')
|| (isset($additional_languages) && strpos($additional_languages, $language) === false)
|| (isset($default_language) && $default_language != $language)
)
{
// Language not supported, fall back to survey's default language
$_SESSION['s_lang'] = $default_language;
//echo "Language not supported, resorting to ".$_SESSION['s_lang']."<br />";
} else {
}
else
{
$_SESSION['s_lang'] = $language;
//echo "Language will be set to ".$_SESSION['s_lang']."<br />";
}
$clang = new limesurvey_lang($_SESSION['s_lang']);
}
Expand Down

0 comments on commit f6ac394

Please sign in to comment.