Changeset 58d38a


Ignore:
Timestamp:
Apr 21, 2012, 10:09:49 AM (10 years ago)
Author:
rene <rene@…>
Branches:
ng_0.9
Children:
2a1ed5
Parents:
1b362f
Message:

fixed smart-reply, broken by changed behavior of isNaN

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • content/vI_getHeader.js

    r1b362f r58d38a  
    5353            var headerNumberToSearch = null;
    5454            if (headerToSearch_splitted.length > 1) parseInt(headerToSearch_splitted[1]);
    55             if (isNaN(headerNumberToSearch) && headerToSearch_splitted.length > 2) headerNumberToSearch = parseInt(headerToSearch_splitted[2]);
     55            if ((!headerNumberToSearch || isNaN(headerNumberToSearch)) && headerToSearch_splitted.length > 2) headerNumberToSearch = parseInt(headerToSearch_splitted[2]);
    5656           
    5757            // create header name to store the value
    5858            var headerNameToStore = headerNameToSearch;
    59             if (!isNaN(headerNumberToSearch)) headerNameToStore += ":" + headerNumberToSearch
     59            if (headerNumberToSearch && !isNaN(headerNumberToSearch)) headerNameToStore += ":" + headerNumberToSearch
    6060           
    6161            getHeader.headerToSearch.push({ headerNameToSearch : headerNameToSearch, headerNumberToSearch : headerNumberToSearch,
     
    8888            let value = "";
    8989            let values = aHeaders.getAll(headerNameToSearch);
    90             if (isNaN(headerNumberToSearch))
     90            if (!headerNumberToSearch || isNaN(headerNumberToSearch))
    9191              for (let i = 0; i < values.length;)
    9292                value += ((value)?(", "):("")) + values[i++];
  • modules/vI_smartIdentityCollection.js

    r1b362f r58d38a  
    235235            var replyHeaderNumber = null;
    236236            if (replyHeader_splitted.length > 1) parseInt(replyHeader_splitted[1]);
    237             if (isNaN(replyHeaderNumber) && replyHeader_splitted.length > 2) replyHeaderNumber = parseInt(replyHeader_splitted[2]);
     237            if ((!replyHeaderNumber || isNaN(replyHeaderNumber)) && replyHeader_splitted.length > 2) replyHeaderNumber = parseInt(replyHeader_splitted[2]);
    238238            // check if Fullnames should be erased
    239239            var replyHeaderEmptyFullNames = ((replyHeader_splitted[1] && replyHeader_splitted[1].match(/@/)) ||
     
    242242            // create header name to find the value
    243243            var replyHeaderNameToRead = replyHeaderName
    244             if (!isNaN(replyHeaderNumber)) replyHeaderNameToRead += ":" + replyHeaderNumber
     244            if (replyHeaderNumber && !isNaN(replyHeaderNumber)) replyHeaderNameToRead += ":" + replyHeaderNumber
    245245           
    246246            // if mailing-list ignore to-header (usually the mailing list address)
Note: See TracChangeset for help on using the changeset viewer.