diff --git a/docs/simplesamlphp-changelog.txt b/docs/simplesamlphp-changelog.txt index f5532b53b705e74ba8ff43f252e96a49dc718782..53239eba9de14ca799e572a18ee4b9b013ce9e62 100644 --- a/docs/simplesamlphp-changelog.txt +++ b/docs/simplesamlphp-changelog.txt @@ -32,6 +32,7 @@ See the upgrade notes for specific information about upgrading. * Removed metashare. * Removed www/auth/login-auto.php. * Removed www/auth/login-feide.php. + * Removed optional parameters from `SimpleSAML_XHTML_Template::getLanguage()`. ### SAML 2 IdP diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php index 149788bb4b72a8af5a4d2981ea2c4f5144a445a5..54674a59a7d119b8b44a7edc1f969555586590c0 100644 --- a/lib/SimpleSAML/XHTML/Template.php +++ b/lib/SimpleSAML/XHTML/Template.php @@ -80,13 +80,13 @@ class SimpleSAML_XHTML_Template { /** * 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 it tries to calculate the preferred language from HTTP headers. * Last it returns the default language. - */ - public function getLanguage($checkHTTP = TRUE, $defaultFallback = TRUE) { - + */ + public function getLanguage() { + // Language is set in object if (isset($this->language)) { return $this->language; @@ -98,20 +98,15 @@ class SimpleSAML_XHTML_Template { $this->language = $languageCookie; return $languageCookie; } - - if ($checkHTTP) { - /* Check if we can find a good language from the Accept-Language http header. */ - $httpLanguage = $this->getHTTPLanguage(); - if ($httpLanguage !== NULL) { - return $httpLanguage; - } + + /* Check if we can find a good language from the Accept-Language http header. */ + $httpLanguage = $this->getHTTPLanguage(); + if ($httpLanguage !== NULL) { + return $httpLanguage; } // Language is not set, and we get the default language from the configuration. - if ($defaultFallback) - return $this->getDefaultLanguage(); - - return NULL; + return $this->getDefaultLanguage(); }