From d92a2b8a87958379c1e2120b1563f066a34848ee Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 12 Jul 2010 08:00:53 +0000
Subject: [PATCH] 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
---
 docs/simplesamlphp-changelog.txt  |  1 +
 lib/SimpleSAML/XHTML/Template.php | 25 ++++++++++---------------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/docs/simplesamlphp-changelog.txt b/docs/simplesamlphp-changelog.txt
index f5532b53b..53239eba9 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 149788bb4..54674a59a 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();
 	}
 
 
-- 
GitLab