Skip to content
Snippets Groups Projects
Commit d92a2b8a authored by Olav Morken's avatar Olav Morken
Browse files

Template: Remove optional parameters from getLanguage().

The parameters were only used from the core:LanguageAdaptor class, which
has been switched over to the get/setLanguageCookie functions.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2412 44740490-163a-0410-bde0-09ae8108e29a
parent d69afdc2
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,7 @@ See the upgrade notes for specific information about upgrading. ...@@ -32,6 +32,7 @@ See the upgrade notes for specific information about upgrading.
* Removed metashare. * Removed metashare.
* Removed www/auth/login-auto.php. * Removed www/auth/login-auto.php.
* Removed www/auth/login-feide.php. * Removed www/auth/login-feide.php.
* Removed optional parameters from `SimpleSAML_XHTML_Template::getLanguage()`.
### SAML 2 IdP ### SAML 2 IdP
......
...@@ -80,13 +80,13 @@ class SimpleSAML_XHTML_Template { ...@@ -80,13 +80,13 @@ class SimpleSAML_XHTML_Template {
/** /**
* getLanguage() will return the language selected by the user, or the default language * getLanguage() will return the language selected by the user, or the default language
* This function first looks for a cached language code, * This function first looks for a cached language code,
* then checks for a language cookie, * then checks for a language cookie,
* then it tries to calculate the preferred language from HTTP headers. * then it tries to calculate the preferred language from HTTP headers.
* Last it returns the default language. * Last it returns the default language.
*/ */
public function getLanguage($checkHTTP = TRUE, $defaultFallback = TRUE) { public function getLanguage() {
// Language is set in object // Language is set in object
if (isset($this->language)) { if (isset($this->language)) {
return $this->language; return $this->language;
...@@ -98,20 +98,15 @@ class SimpleSAML_XHTML_Template { ...@@ -98,20 +98,15 @@ class SimpleSAML_XHTML_Template {
$this->language = $languageCookie; $this->language = $languageCookie;
return $languageCookie; return $languageCookie;
} }
if ($checkHTTP) { /* Check if we can find a good language from the Accept-Language http header. */
/* Check if we can find a good language from the Accept-Language http header. */ $httpLanguage = $this->getHTTPLanguage();
$httpLanguage = $this->getHTTPLanguage(); if ($httpLanguage !== NULL) {
if ($httpLanguage !== NULL) { return $httpLanguage;
return $httpLanguage;
}
} }
// Language is not set, and we get the default language from the configuration. // Language is not set, and we get the default language from the configuration.
if ($defaultFallback) return $this->getDefaultLanguage();
return $this->getDefaultLanguage();
return NULL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment