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

Utilities::getAcceptLanguage: Ensuer proper ordering of the output array.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@478 44740490-163a-0410-bde0-09ae8108e29a
parent f2b0c8db
No related branches found
No related tags found
No related merge requests found
...@@ -674,6 +674,8 @@ class SimpleSAML_Utilities { ...@@ -674,6 +674,8 @@ class SimpleSAML_Utilities {
* If an language includes a region, then the result will include both the language with the region * If an language includes a region, then the result will include both the language with the region
* and the language without the region. * and the language without the region.
* *
* The returned array will be in the same order as the input.
*
* @return An associative array with each language and the score for that language. * @return An associative array with each language and the score for that language.
*/ */
public static function getAcceptLanguage() { public static function getAcceptLanguage() {
...@@ -710,6 +712,9 @@ class SimpleSAML_Utilities { ...@@ -710,6 +712,9 @@ class SimpleSAML_Utilities {
} }
} }
/* Remove the old key to ensure that the element is added to the end. */
unset($ret[$l]);
/* Set the quality in the result. */ /* Set the quality in the result. */
$ret[$l] = $q; $ret[$l] = $q;
......
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