Bug 876289 - Start page version detection broken in case of first minor release
authorjh@junetz.de
Sun, 26 May 2013 21:38:32 +0000
changeset 1091 6772dbe70fbd76f53584089bded26dc4a475e2c2
parent 1090 5081ce1b174255956943336f26f83399161e49c7
child 1092 6ce9138a291283a810853340b1a365a01de738ea
push id1
push userhg
push dateTue, 07 Apr 2015 21:00:21 +0000
bugs876289
Bug 876289 - Start page version detection broken in case of first minor release
src/start/index-test.en.html
--- a/src/start/index-test.en.html
+++ b/src/start/index-test.en.html
@@ -76,18 +76,19 @@
     if (smver[1].match(/^[\d\.]+$/)) {
       // stable build, leave "friendy" intro box turned on
 
       // check for version number and display a warning and download box if we have a newer version
       var curver = "[% releaseversion %]";
       var curver_parts = curver.split(".");
       var oldversion = false;
       for (var i = 0; i < curver_parts.length; i++) {
-        if (parseInt(curver_parts[i]) > parseInt(smver_parts[i])) {
+        if (i == smver_parts.length || parseInt(curver_parts[i]) > parseInt(smver_parts[i])) {
           oldversion = true;
+          break;
         }
         else if (parseInt(curver_parts[i]) < parseInt(smver_parts[i])) {
           break;
         }
       }
       if (oldversion) {
         highlightDownload("dlnew", false);
         var vertext = document.createTextNode(" (" + smver[1] + ")");
@@ -111,16 +112,17 @@
         var curbeta = "[% betaversion %]";
         var curbeta_parts = curbeta.split(".");
         var oldbeta = false;
         for (var i = 0; i < curbeta_parts.length; i++) {
           // don't use parseInt() for beta - this means that parts with numbers
           // larger than 9 are incorrect but alphas and betas are correct
           if (curbeta_parts[i] > smver_parts[i]) {
             oldbeta = true;
+            break;
           }
           else if (curbeta_parts[i] < smver_parts[i]) {
             break;
           }
         }
         if (oldbeta) {
           displayElement("nagBox-beta", true);
         }