[js-embedded-discovery COMMIT] in /trunk: doc/RELEASE-NOTES.txt src/javascript/idpselect.js

noreply at shibboleth.net noreply at shibboleth.net
Mon Jan 5 08:21:17 EST 2015


Author: rdw
Date: Mon Jan  5 08:21:17 2015
New Revision: 117

URL: http://svn.shibboleth.net/view/js-embedded-discovery?rev=117&view=rev
Log:
EDS-33 Handle the saved IdPs in the correct order (last in the list is the most recent...)

Modified:
    trunk/doc/RELEASE-NOTES.txt
    trunk/src/javascript/idpselect.js

Modified: trunk/doc/RELEASE-NOTES.txt
URL: http://svn.shibboleth.net/view/js-embedded-discovery/trunk/doc/RELEASE-NOTES.txt?rev=117&r1=116&r2=117&view=diff
==============================================================================
--- trunk/doc/RELEASE-NOTES.txt (original)
+++ trunk/doc/RELEASE-NOTES.txt Mon Jan  5 08:21:17 2015
@@ -8,6 +8,7 @@
 EDS-39 Ship non mimimized sources
 EDS-30 Use %20 as the separator for entityIDs in the cookie, but continue to understand '+'
 EDS-58 Configurable writing of the cookie.  Allows the SP to write it instead.
+EDS-33 Ordering of multiple selected IdPs is backwards.
 
 Changed in V1.0.3
 =============================================

Modified: trunk/src/javascript/idpselect.js
URL: http://svn.shibboleth.net/view/js-embedded-discovery/trunk/src/javascript/idpselect.js?rev=117&r1=116&r2=117&view=diff
==============================================================================
--- trunk/src/javascript/idpselect.js (original)
+++ trunk/src/javascript/idpselect.js Mon Jan  5 08:21:17 2015
@@ -1198,11 +1198,11 @@
                 cookieValues = cookieValues.replace(/^\s+|\s+$/g, '');
                 cookieValues = cookieValues.replace('+','%20');
                 cookieValues = cookieValues.split('%20');
-                for(j=0; j< cookieValues.length; j++){
-                    if (0 === cookieValues[j].length) {
+                for(j=cookieValues.length; j > 0; j--){
+                    if (0 === cookieValues[j-1].length) {
                         continue;
                     }
-                    var dec = base64Decode(decodeURIComponent(cookieValues[j]));
+                    var dec = base64Decode(decodeURIComponent(cookieValues[j-1]));
                     if (dec.length > 0) {
                         userSelectedIdPs.push(dec);
                     }
@@ -1229,9 +1229,9 @@
         if (length > 5) {
             length = 5;
         }
-        for(var i=0; i < length; i++){
-            if (idps[i].length > 0) {
-                cookieData.push(encodeURIComponent(base64Encode(idps[i])));
+        for(var i=length; i > 0; i--){
+            if (idps[i-1].length > 0) {
+                cookieData.push(encodeURIComponent(base64Encode(idps[i-1])));
             }
         }
         



More information about the commits mailing list