Skip to content
Snippets Groups Projects
Commit c39d1b8c authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

More bugfixes. The SimpleSAML\Locale\Language::$languageParameterName and...

More bugfixes. The SimpleSAML\Locale\Language::$languageParameterName and SimpleSAML\Locale\Language::$language properties should be private, and therefore not accessed from the outside of their respective classes. Add getters instead.
parent 57583196
No related branches found
No related tags found
No related merge requests found
...@@ -28,7 +28,7 @@ class Language ...@@ -28,7 +28,7 @@ class Language
/** /**
* HTTP GET language parameter name. * HTTP GET language parameter name.
*/ */
public $languageParameterName = 'language'; private $languageParameterName = 'language';
/** /**
...@@ -113,6 +113,17 @@ class Language ...@@ -113,6 +113,17 @@ class Language
} }
/**
* Get the language parameter name.
*
* @return string The language parameter name.
*/
public function getLanguageParameterName()
{
return $this->languageParameterName;
}
/** /**
* This method returns the preferred language for the user based on the Accept-Language HTTP header. * This method returns the preferred language for the user based on the Accept-Language HTTP header.
* *
......
...@@ -68,6 +68,17 @@ class Translate ...@@ -68,6 +68,17 @@ class Translate
} }
/**
* Return the internal language object used by this translator.
*
* @return \SimpleSAML\Locale\Language
*/
public function getLanguage()
{
return $this->language;
}
/** /**
* This method retrieves a dictionary with the name given. * This method retrieves a dictionary with the name given.
* *
......
...@@ -191,7 +191,7 @@ if($onLoad !== '') { ...@@ -191,7 +191,7 @@ if($onLoad !== '') {
if ($current) { if ($current) {
$textarray[] = $langnames[$lang]; $textarray[] = $langnames[$lang];
} else { } else {
$textarray[] = '<a href="' . htmlspecialchars(\SimpleSAML\Utils\HTTP::addURLParameters(\SimpleSAML\Utils\HTTP::getSelfURL(), array($this->getTranslator()->language->languageParameterName => $lang))) . '">' . $textarray[] = '<a href="' . htmlspecialchars(\SimpleSAML\Utils\HTTP::addURLParameters(\SimpleSAML\Utils\HTTP::getSelfURL(), array($this->getTranslator()->getLanguage()->getLanguageParameterName() => $lang))) . '">' .
$langnames[$lang] . '</a>'; $langnames[$lang] . '</a>';
} }
} }
......
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